Update media player block
This commit is contained in:
parent
a1ec3cb3d3
commit
e60c5081a8
2 changed files with 23 additions and 0 deletions
21
i3/blocks/mediaplayer
Executable file
21
i3/blocks/mediaplayer
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
COMMAND="playerctl --player=$BLOCK_INSTANCE"
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
1) $COMMAND previous ;;
|
||||||
|
3) $COMMAND next ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$($COMMAND status)" = "Playing" ]; then
|
||||||
|
colour="#00FF00"
|
||||||
|
else
|
||||||
|
colour="#FF8000"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ret="<span foreground='$colour'>$($COMMAND metadata title)</span>"
|
||||||
|
ret="$ret - $($COMMAND metadata artist)"
|
||||||
|
|
||||||
|
echo "$ret";
|
|
@ -45,9 +45,11 @@ signal=11
|
||||||
# This displays "ARTIST - SONG" if a music is playing.
|
# This displays "ARTIST - SONG" if a music is playing.
|
||||||
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
|
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
|
||||||
[mediaplayer]
|
[mediaplayer]
|
||||||
|
command=~/.dotfiles/i3/blocks/mediaplayer
|
||||||
instance=spotify
|
instance=spotify
|
||||||
interval=5
|
interval=5
|
||||||
signal=10
|
signal=10
|
||||||
|
markup=pango
|
||||||
|
|
||||||
# Date Time
|
# Date Time
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue