blob: cca7b8d61dfb348dca39052f41bd8d4e89181878 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/bash
STATE="$(mpc | grep -o playing)"
NAME="$(basename "$(mpc current)")"
notify() {
if [[ -n "$STATE" ]]; then
notify-send "Currently playing" "${NAME%.*}"
else
notify-send "MPD is currently paused"
fi
}
case "$1" in
"previous")
mpc -q prev
playerctl -s previous
;;
"toggle")
mpc -q toggle
playerctl -s play-pause
;;
"next")
mpc -q next
playerctl -s next
;;
"notify")
notify
;;
*)
echo "[ Error ] Unknown command"
;;
esac
|