Add pdfview to view PDF file in PAGER

This commit is contained in:
Arun Prakash Jana 2019-05-05 20:56:37 +05:30
parent b764055314
commit 21ee3489c2
No known key found for this signature in database
GPG key ID: A75979F35C080412
2 changed files with 13 additions and 0 deletions

View file

@ -13,6 +13,7 @@
| nmount | sh | pmount | Toggle mount status of a device as normal user | | nmount | sh | pmount | Toggle mount status of a device as normal user |
| nwal | sh | nitrogen | Set the selected image as wallpaper using nitrogen | | 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 | | 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 |
| picker | sh | nnn | Pick files and pipe the newline-separated list to another utility | | 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 | | 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))| | 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))|

12
plugins/pdfview Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env sh
# Description: View a PDF file in pager
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if ! [ -z "$1" ]; then
if [ $(head -c 4 "$1") = "%PDF" ]; then
pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER
fi
fi