summaryrefslogtreecommitdiff
path: root/bin/guiscripts/dmvid
blob: 23e2c56eb0418ba180c4f1299d9925216a11ddb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env sh

find ${1:-~/vids ~/dl} 2> /dev/null |
	grep ".\+\.\(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 | 
	cut -f 1 -d ':')"
test -z "$choice" &&
	exit 1

mpv "$(sed -n "${choice}p" /tmp/dmvids)"