commit ae04c89
hovercats
·
2022-06-18 11:39:31 +0000 UTC
parent 5d91e4f
add dpdf
1 files changed,
+24,
-0
A
dpdf
A
dpdf
+24,
-0
1@@ -0,0 +1,24 @@
2+#!/bin/sh -e
3+
4+# tiny script to see files in Documents. mainly pdfs for me.
5+# opened with mupdf
6+
7+# set DIR variable to whatever floats your boat
8+DIR="$HOME"/Documents
9+
10+case $1 in
11+ -d)
12+ cd $DIR
13+ for file in "$DIR"/*; do
14+ [ -e "$file" ] || [ -L "$file" ] || continue
15+ printf "%s\n" "$file"
16+ done | awk -F "/" '{print $NF}' | dmenu -i -l 20 -p 'Delete:' | xargs -I {} rm -rf {}
17+ ;;
18+ *)
19+ cd $DIR
20+ for file in "$DIR"/*; do
21+ [ -e "$file" ] || [ -L "$file" ] || continue
22+ printf "%s\n" "$file"
23+ done | awk -F "/" '{print $NF}' | dmenu -i -l 20 -p 'View:' | xargs -I {} mupdf {}
24+ ;;
25+esac