summaryrefslogtreecommitdiff
path: root/bin/guiscripts/dmpdf
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-16 21:54:54 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-16 21:54:54 +0200
commit102e7d997a40a7215b10686ce2b0d006d5a97c2e (patch)
tree86449e1b494d7c209563f6870a5c7493528434aa /bin/guiscripts/dmpdf
parenta58ae56e98a8d9fcbe7fc7beaa976a4d164ee99a (diff)
parent0403da37e183e41d3b949b473038806059130815 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/guiscripts/dmpdf')
-rwxr-xr-xbin/guiscripts/dmpdf5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/guiscripts/dmpdf b/bin/guiscripts/dmpdf
index e8d4601..56356d7 100755
--- a/bin/guiscripts/dmpdf
+++ b/bin/guiscripts/dmpdf
@@ -6,9 +6,10 @@ choice="$(\
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]+:")"
+ grep -oE "^[0-9]+:" |
+ cut -f1 -d:)"
if [ -z "$choice" ]; then
exit
fi
-file="$(sed -n "${choice::-1}p" "$tmp")"
+file="$(sed -n "${choice}p" "$tmp")"
zathura "$file" &