dotfiles/.config/awesome/music_wake.sh

16 lines
288 B
Bash
Raw Normal View History

2019-10-12 09:49:51 +02:00
#!/bin/sh
get_status() {
mpc status | tr '\n' '\r' | sed 's/.*\[\(.*\)\].*/\1/'
}
while true
do
if [ $(get_status) == "playing" ]; then
systemd-inhibit --who="Me, the one and only" --why="Because I say so" --what=handle-lid-switch sleep 10
sleep 5
fi
done