summaryrefslogtreecommitdiff
path: root/bin/guiscripts/dmpdf
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-03-12 18:35:36 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-03-12 18:35:36 +0100
commitdef003a709daac88d91499f50e9d3fd246ee3db2 (patch)
tree6b18eec5e30f300bca47cf3b8bd89cab12627def /bin/guiscripts/dmpdf
parente1b3f28bb1f8f1f9084ae96aa5ef79d39769049f (diff)
parentfab8d61418e2652881a56b586588f3373df5f971 (diff)
Merge remote-tracking branch 'refs/remotes/origin/main'
Diffstat (limited to 'bin/guiscripts/dmpdf')
-rwxr-xr-xbin/guiscripts/dmpdf14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/guiscripts/dmpdf b/bin/guiscripts/dmpdf
index 21f3ed0..2d51760 100755
--- a/bin/guiscripts/dmpdf
+++ b/bin/guiscripts/dmpdf
@@ -1,14 +1,14 @@
#!/bin/bash
-find ${1:-$HOME/docs $HOME/dl} 2> /dev/null | grep -E ".+\.pdf" | sort > /tmp/dmpdf
+tmp="/tmp/dmpdf"
+find ${1:-$HOME/docs $HOME/dl} 2> /dev/null | grep -E ".+\.pdf" | sort > "$tmp"
choice="$(\
- sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' /tmp/dmpdf \
- | awk '{printf "%s %s\n", NR ":", $0}' \
- | dmenu -l 10 -g 1 -x -i \
- | grep -oE "^[0-9]+:" \
-)"
+ sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' "$tmp" |
+ awk '{printf "%s %s\n", NR ":", $0}' |
+ dmenu -p "pdf:" -l 10 -g 1 -x -i |
+ grep -oE "^[0-9]+:")"
if [ -z "$choice" ]; then
exit
fi
-file="$(sed -n "${choice::-1}p" /tmp/dmpdf)"
+file="$(sed -n "${choice::-1}p" "$tmp")"
zathura "$file" &