Add dotfiles
This commit is contained in:
parent
49bfe1a4d3
commit
b6e01a720b
52 changed files with 4701 additions and 0 deletions
25
dwmbar/modules/mpd
Executable file
25
dwmbar/modules/mpd
Executable file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue