added spotifyd title display in polybar
This commit is contained in:
parent
5bff7a1f1e
commit
1148d940ec
@ -53,7 +53,7 @@ font-2 = siji:pixelsize=10;1
|
|||||||
|
|
||||||
modules-left = i3
|
modules-left = i3
|
||||||
modules-center =
|
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-position = right
|
||||||
tray-padding = 2
|
tray-padding = 2
|
||||||
@ -404,6 +404,13 @@ menu-2-0-exec = sudo poweroff
|
|||||||
menu-2-1 = cancel
|
menu-2-1 = cancel
|
||||||
menu-2-1-exec = menu-open-0
|
menu-2-1-exec = menu-open-0
|
||||||
|
|
||||||
|
[module/spotifyd]
|
||||||
|
type = custom/ipc
|
||||||
|
|
||||||
|
hook-0 = $HOME/.config/polybar/spotifyd-meta.sh
|
||||||
|
|
||||||
|
initial = 1
|
||||||
|
|
||||||
[settings]
|
[settings]
|
||||||
screenchange-reload = true
|
screenchange-reload = true
|
||||||
;compositing-background = xor
|
;compositing-background = xor
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
#!/usr/bin/env sh
|
#!/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 $?
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user