-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mpdcontrol.py
50 lines (29 loc) · 1.31 KB
/
.mpdcontrol.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/zsh
# MPD/MPC by olshrimpeyes
nowplaying=`mpc | grep - | sed -e 's/\&/&/g'`
playing=`mpc | grep playing `
echo "<openbox_pipe_menu>"
if [[ -z $nowplaying ]]
then
echo "<item label=\"Not Playing\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
else
echo "<item label=\""$nowplaying"\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
if [[ -z $playing ]]
then
echo "<item label=\"Paused\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
else
echo "<item label=\""$playing"\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
fi
fi
echo "<separator/>"
if [[ -z $playing ]]
then
echo "<item label=\"Play\"><action name=\"Execute\"><execute>mpc play</execute></action></item>"
else
echo "<item label=\"Pause\"><action name=\"Execute\"><execute>mpc pause</execute></action></item>"
echo "<item label=\"Stop\"><action name=\"Execute\"><execute>mpc stop</execute></action></item>"
fi
echo "<item label=\"Next\"><action name=\"Execute\"><execute>mpc next</execute></action></item>"
echo "<item label=\"Previous\"><action name=\"Execute\"><execute>mpc prev</execute></action></item>"
echo "<item label=\"Volume\"><action name=\"Execute\"><execute>terminator -e alsamixer</execute></action></item>"
echo "</openbox_pipe_menu>"