one round of waybar styling later
This commit is contained in:
16
scripts/waybar-music-status.sh
Normal file
16
scripts/waybar-music-status.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
function _sanitize {
|
||||
sed -r "s/(^[ ]*)|([ ]*$)//g" | sed -r 's/\&/\&/g' | sed -r 's/\"/\"/g' | sed -r "s/'/\'/g"
|
||||
}
|
||||
|
||||
# {{artist}} — {{title}}
|
||||
|
||||
SONGNAME="$( playerctl -s -p cider,OCbwoy3_s_iPhone metadata -f "{{artist}} — {{title}}" | _sanitize )"
|
||||
ALBUMNAME="$( playerctl -s -p cider,OCbwoy3_s_iPhone metadata album | _sanitize )"
|
||||
|
||||
if [ ${#SONGNAME} -gt 0 ] ; then
|
||||
printf "{\"text\": \" $SONGNAME\", \"tooltip\": \"$ALBUMNAME\", \"class\":\"music\" }"
|
||||
else
|
||||
printf "{\"text\": \"\", \"tooltip\": \" \", \"class\":\"invisible\" }"
|
||||
fi
|
||||
Reference in New Issue
Block a user