summary refs log tree commit diff
path: root/bin/play-music
blob: 14e91f1eb297990bafc83287420fa6863c639051 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -eux

music_dir=/run/media/robert/fwdrive/music

mpa() {
	mpv --profile=mpa \
		--directory-filter-types=audio \
		--autocreate-playlist=filter \
		--wayland-app-id=mpv.play-music \
		"$@"
}

case "$1" in
shuffle)
	mpa --shuffle $music_dir
	;;
select)
	cd $music_dir
	subdir=$(find . -type d -printf "%P\n" | shuf | fuzzel -d -w 80)
	mpa "$subdir"
	;;
esac