plugins/README.md | 2 +- plugins/hexview | 8 ++++++-- diff --git a/plugins/README.md b/plugins/README.md index 14eb976549f9d2c950743cc92c195bfbc585a372..9cdaa2a3740cbbbcab368ba846bd502c7e5abbf0 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -41,7 +41,7 @@ | [fzz](fzz) | Change to any directory in the z database with fzf | sh | fzf, z | | [getplugs](getplugs) | Update plugins to installed `nnn` version | sh | curl | | [gutenread](gutenread) | Browse, download, read from Project Gutenberg | sh | curl, unzip, w3m
[epr](https://github.com/wustho/epr) (optional) | | [gpg\*](gpg\*) | Encrypt/decrypt files using GPG | sh | gpg | -| [hexview](hexview) | View a file in hex in `$PAGER` | sh | xxd | +| [hexview](hexview) | View a file in hex in `$PAGER` | sh | [hx](https://github.com/krpors/hx)/xxd | | [imgresize](imgresize) | Resize images in dir to screen resolution | sh | [imgp](https://github.com/jarun/imgp) | | [imgthumb](imgthumb) | View thumbnail of an image or dir of images | sh | [lsix](https://github.com/hackerb9/lsix) | | [imgur](imgur) | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) | bash | - | diff --git a/plugins/hexview b/plugins/hexview index 60b342817b664cabfd99e14fb502ed0fe4f1811c..ce17a60d39ef39a2260c7a7298338b50e6aa88f3 100755 --- a/plugins/hexview +++ b/plugins/hexview @@ -1,11 +1,15 @@ #!/usr/bin/env sh # Description: View a file in hex -# Dependencies: xxd and $PAGER +# Dependencies: hx (https://github.com/krpors/hx)/xxd and $PAGER # # Shell: POSIX compliant # Author: Arun Prakash Jana if ! [ -z "$1" ]; then - xxd "$1" | $PAGER + if which hx >/dev/null 2>&1; then + hx "$1" + else + xxd "$1" | $PAGER + fi fi