Procházet zdrojové kódy

Add hx as alternative hex viewer

master
Arun Prakash Jana před 4 roky
rodič
revize
ef0e973134
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: A75979F35C080412
2 změnil soubory, kde provedl 7 přidání a 3 odebrání
  1. +1
    -1
      plugins/README.md
  2. +6
    -2
      plugins/hexview

+ 1
- 1
plugins/README.md Zobrazit soubor

@@ -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 |
| [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 |
| [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 | - |


+ 6
- 2
plugins/hexview Zobrazit soubor

@@ -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

Načítá se…
Zrušit
Uložit