Moves i3 to LEGACY
This commit is contained in:
parent
b811277aca
commit
5095b12c47
20 changed files with 0 additions and 0 deletions
30
LEGACY/i3/blocks/mediaplayer
Executable file
30
LEGACY/i3/blocks/mediaplayer
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/sh
|
||||
|
||||
|
||||
#COMMAND="playerctl --player=$BLOCK_INSTANCE"
|
||||
COMMAND="playerctl"
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) $COMMAND previous ;;
|
||||
3) $COMMAND next ;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "$($COMMAND status 2> /dev/null )" = "Playing" ]; then
|
||||
colour="#00FF00"
|
||||
else
|
||||
colour="#FF8000"
|
||||
fi
|
||||
|
||||
title=$($COMMAND metadata title 2> /dev/null | sed "s/\&/\&/g")
|
||||
artist=$($COMMAND metadata artist 2> /dev/null | sed "s/\&/\&/g")
|
||||
|
||||
if [ "$title" != "" ]; then
|
||||
ret="<span foreground='$colour'>$title</span>"
|
||||
if [ -n "$artist" ]; then
|
||||
ret="$ret - $artist"
|
||||
fi
|
||||
|
||||
echo "$ret";
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue