aboutsummaryrefslogtreecommitdiffstats
path: root/.config/init/funcs/mpd-sleep
blob: c01d7340ed9ba97545bc92196ecd0a2481ba928a (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/zsh

# power off after finishing mpd playlist
mpc play > /dev/null
while true; do
	mpc idle player > /dev/null || return 1
	if [[ -z "$(mpc status | grep playing)" ]]; then
		poweroff
	fi
done