diff options
Diffstat (limited to 'bin/guiscripts/dmvid')
-rwxr-xr-x | bin/guiscripts/dmvid | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/guiscripts/dmvid b/bin/guiscripts/dmvid new file mode 100755 index 0000000..ee7f865 --- /dev/null +++ b/bin/guiscripts/dmvid @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +find ${1:-~/movies ~/Downloads} 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" |