blob: 5db0d64a981edbb799dfc0c04512fa90de7f8037 (
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
|
#!/bin/bash
PREFIX_PLAY=' '
PREFIX_PAUSE=' '
get_mpd()
{
current_song=$(mpc current)
if [[ "$current_song" = "" ]]; then
exit 0
else
playpause=$(mpc | awk '/\[.*]/{split($0, a, " "); print a[1]}')
if [[ "$playpause" = "[playing]" ]]; then
current_song=$PREFIX_PLAY$current_song
elif [[ "$playpause" = "[paused]" ]]; then
current_song=$PREFIX_PAUSE$current_song
fi
fi
echo $current_song
}
get_mpd
|