mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Add hx as alternative hex viewer
This commit is contained in:
parent
92ff1447c0
commit
ef0e973134
|
@ -41,7 +41,7 @@ Plugins are installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`.
|
||||||
| [getplugs](getplugs) | Update plugins to installed `nnn` version | sh | curl |
|
| [getplugs](getplugs) | Update plugins to installed `nnn` version | sh | curl |
|
||||||
| [gutenread](gutenread) | Browse, download, read from Project Gutenberg | sh | curl, unzip, w3m<br>[epr](https://github.com/wustho/epr) (optional) |
|
| [gutenread](gutenread) | Browse, download, read from Project Gutenberg | sh | curl, unzip, w3m<br>[epr](https://github.com/wustho/epr) (optional) |
|
||||||
| [gpg\*](gpg\*) | Encrypt/decrypt files using GPG | sh | gpg |
|
| [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) |
|
| [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) |
|
| [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 | - |
|
| [imgur](imgur) | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) | bash | - |
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
# Description: View a file in hex
|
# Description: View a file in hex
|
||||||
# Dependencies: xxd and $PAGER
|
# Dependencies: hx (https://github.com/krpors/hx)/xxd and $PAGER
|
||||||
#
|
#
|
||||||
# Shell: POSIX compliant
|
# Shell: POSIX compliant
|
||||||
# Author: Arun Prakash Jana
|
# Author: Arun Prakash Jana
|
||||||
|
|
||||||
if ! [ -z "$1" ]; then
|
if ! [ -z "$1" ]; then
|
||||||
|
if which hx >/dev/null 2>&1; then
|
||||||
|
hx "$1"
|
||||||
|
else
|
||||||
xxd "$1" | $PAGER
|
xxd "$1" | $PAGER
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue