瀏覽代碼

Add pdfview to view PDF file in PAGER

master
Arun Prakash Jana 5 年之前
父節點
當前提交
21ee3489c2
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A75979F35C080412
共有 2 個檔案被更改,包括 13 行新增0 行删除
  1. +1
    -0
      plugins/README.md
  2. +12
    -0
      plugins/pdfview

+ 1
- 0
plugins/README.md 查看文件

@@ -13,6 +13,7 @@
| nmount | sh | pmount | 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 |
| 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))|


+ 12
- 0
plugins/pdfview 查看文件

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

Loading…
取消
儲存