summaryrefslogtreecommitdiff
path: root/bin/guiscripts/dmvid
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-03-03 19:53:22 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-03-03 19:53:22 +0100
commit97487ed1431ed0cfa4f5b6facd69dbd0f13911f4 (patch)
treecacc50f96ebb5a9b2a3c8d374bbf9e8ccedc64cf /bin/guiscripts/dmvid
parent5522d426e21cbedb8791ee4399ff7d28a4c6f10e (diff)
renamed dmscripts to guiscripts
Diffstat (limited to 'bin/guiscripts/dmvid')
-rwxr-xr-xbin/guiscripts/dmvid14
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"