dwm and dwmbar
This commit is contained in:
1 parent
307448edd3
commit
135fe92331
50 files changed
+1846
No files matched your search
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
PREFIX_PLAY=' '
|
||||
PREFIX_PAUSE=' '
|
||||
|
||||
get_mpd()
|
||||
{
|
||||
current_song="$(mpc current)"
|
||||
|
||||
if [[ "$current_song" = "" ]]; then
|
||||
echo " "
|
||||
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
|
||||
Reference in new issue
Block a user