diff options
-rw-r--r-- | .config/zathura/zathurarc | 1 | ||||
-rwxr-xr-x | .scripts/zathura-random-page | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc new file mode 100644 index 0000000..f8cab34 --- /dev/null +++ b/.config/zathura/zathurarc @@ -0,0 +1 @@ +map t exec "zathura-random-page $FILE" diff --git a/.scripts/zathura-random-page b/.scripts/zathura-random-page new file mode 100755 index 0000000..c8123af --- /dev/null +++ b/.scripts/zathura-random-page @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +MAX="$(pdfinfo "$1" | awk '/^Pages:/ {print $2}')" +PAGE="$(shuf -i 1-"$MAX" -n 1)" +xdotool type "${PAGE}G" |