aboutsummaryrefslogtreecommitdiff
path: root/.scripts/zathura-random-page
diff options
context:
space:
mode:
Diffstat (limited to '.scripts/zathura-random-page')
-rwxr-xr-x.scripts/zathura-random-page7
1 files changed, 7 insertions, 0 deletions
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"