added spotifyd title display in polybar

This commit is contained in:
Niklas 2020-06-17 11:25:22 +02:00
parent 5bff7a1f1e
commit 1148d940ec
2 changed files with 24 additions and 2 deletions

View File

@ -53,7 +53,7 @@ font-2 = siji:pixelsize=10;1
modules-left = i3
modules-center =
modules-right = mpd pulseaudio memory cpu wlan eth battery date
modules-right = spotifyd pulseaudio memory cpu wlan eth battery date
tray-position = right
tray-padding = 2
@ -404,6 +404,13 @@ menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[module/spotifyd]
type = custom/ipc
hook-0 = $HOME/.config/polybar/spotifyd-meta.sh
initial = 1
[settings]
screenchange-reload = true
;compositing-background = xor

View File

@ -1,3 +1,18 @@
#!/usr/bin/env sh
notify-send "$(playerctl -f "{{title}} - {{artist}}" metadata)"
# send ipc to polybar to update
hook (){
polybar-msg hook spotifyd 1
}
i=0
until hook || [ $i -gt 10 ];
do
sleep 1
let i=i+1
done
exit $?