diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-12 18:35:36 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-12 18:35:36 +0100 |
commit | def003a709daac88d91499f50e9d3fd246ee3db2 (patch) | |
tree | 6b18eec5e30f300bca47cf3b8bd89cab12627def /bin/guiscripts/dmvid | |
parent | e1b3f28bb1f8f1f9084ae96aa5ef79d39769049f (diff) | |
parent | fab8d61418e2652881a56b586588f3373df5f971 (diff) |
Merge remote-tracking branch 'refs/remotes/origin/main'
Diffstat (limited to 'bin/guiscripts/dmvid')
-rwxr-xr-x | bin/guiscripts/dmvid | 20 |
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)" |