summaryrefslogtreecommitdiff
path: root/bin/guiscripts
diff options
context:
space:
mode:
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-xbin/guiscripts/dmvid20
1 files changed, 9 insertions, 11 deletions
diff --git a/bin/guiscripts/dmvid b/bin/guiscripts/dmvid
index 16e164f..fe3155e 100755
--- a/bin/guiscripts/dmvid
+++ b/bin/guiscripts/dmvid
@@ -1,14 +1,12 @@
#!/usr/bin/env bash
find ${1:-~/vids ~/dl} 2> /dev/null | grep -E ".+\.(webm|mp4|mpeg|mkv)$" | sort > /tmp/dmvids
-choice="$(\
- sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' /tmp/dmvids \
- | awk '{printf "%s %s\n", NR ":", $0}' \
- | dmenu -l 10 -g 1 -x -i \
- | grep -zoE "^[0-9]+:" \
-)"
-if [ -z "$choice" ]; then
- exit
-fi
-vid="$(sed -n "${choice::-1}p" /tmp/dmvids)"
-mpv "$vid"
+
+choice="$(sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' /tmp/dmvids |
+ awk '{printf "%s %s\n", NR ":", $0}' |
+ dmenu -l 10 -g 1 -x -i |
+ grep -zoE "^[0-9]+:")"
+test -z "$choice" &&
+ exit 1
+
+mpv "$(sed -n "${choice::-1}p" /tmp/dmvids)"