Selaa lähdekoodia

Update plugins, add mutool to view PDF

master
Arun Prakash Jana 5 vuotta sitten
vanhempi
commit
9ba3cb3e9b
No known key found for this signature in database GPG Key ID: A75979F35C080412
3 muutettua tiedostoa jossa 19 lisäystä ja 4 poistoa
  1. +3
    -3
      plugins/README.md
  2. +4
    -1
      plugins/nmount
  3. +12
    -0
      plugins/pdfview

+ 3
- 3
plugins/README.md Näytä tiedosto

@@ -4,16 +4,16 @@
| fzy-edit | sh | fzy | Fuzzy find a file in directory subtree and edit in vim |
| fzy-open | sh | fzy | Fuzzy find a file in directory subtree and open using xdg-open |
| getplugs | sh | wget | Update plugins |
| hexview | sh | xxd, `$PAGER` | View a file in hex |
| hexview | sh | xxd | View a file in hex in `$PAGER` |
| imgresize | sh | [imgp](https://github.com/jarun/imgp) | Resize images in directory to screen resolution |
| imgur | bash | - | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) |
| ipinfo | sh | curl, whois | Fetch external IP address and whois information |
| kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device |
| ndiff | bash | vimdiff | Diff for selection (limited to 2 for directories) |
| nmount | sh | pmount | Toggle mount status of a device as normal user |
| nmount | sh | pmount, udisks2 | Toggle mount status of a device as normal user |
| nwal | sh | nitrogen | Set the selected image as wallpaper using nitrogen |
| pastebin | sh | [pastebinit](https://launchpad.net/pastebinit) | Paste contents of current (text) file to paste.ubuntu.com |
| pdfview | sh | pdftotext, `$PAGER` | View current PDF file |
| pdfview | sh | pdftotext/mupdf-tools | View current PDF file in `$PAGER` |
| picker | sh | nnn | Pick files and pipe the newline-separated list to another utility |
| pywal | sh | pywal | Set selected image as wallpaper, change terminal color scheme |
| sxiv | sh | sxiv | Browse images in a dir in sxiv, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts))|


+ 4
- 1
plugins/nmount Näytä tiedosto

@@ -4,9 +4,12 @@
# If the device is not mounted, it will be mounted.
# If the device is mounted, it will be unmounted and powered down.
#
# Note: The script uses Linux-specific lsblk to list block devices. Alternatives:
# Note:
# - The script uses Linux-specific lsblk to list block devices. Alternatives:
# macOS: "diskutil list"
# BSD: "geom disk list"
# - The script uses udisksctl (from udisks2) to pwoer down devices. This is also Linux-specific.
# Users on non-Linux platforms can comment it and use an alterntive to power-down disks.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana


+ 12
- 0
plugins/pdfview Näytä tiedosto

@@ -2,11 +2,23 @@

# Description: View a PDF file in pager
#
# Notes:
# - $PAGER must be 'less -R' or 'most'
# - To use mutool, uncomment the relevant lines and comment the pdftotext line
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana

if ! [ -z "$1" ]; then
if [ $(head -c 4 "$1") = "%PDF" ]; then
# Convert using pdftotext
pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER

# Convert using mutool
# file=`basename "$1"`
# txt=/tmp/"$file".txt
# mutool convert -o "$txt" "$1"
# eval $PAGER $txt
# rm "$txt"
fi
fi

Loading…
Peruuta
Tallenna