better song info polybar module

This commit is contained in:
Niklas 2021-01-16 23:32:46 +01:00
parent c4a1c0422a
commit 55ba702c7f
5 changed files with 10 additions and 30 deletions

View File

@ -364,11 +364,6 @@
# msg_urgency = critical # msg_urgency = critical
# fullscreen = show # fullscreen = show
[spotify-polybar]
appname = Spotify
skip_display = yes
script = ~/.config/dunst/polybar-hook.sh
[notification-sound] [notification-sound]
appname = * appname = *
script = ~/.config/dunst/play-notification-sound.sh script = ~/.config/dunst/play-notification-sound.sh

View File

@ -1,3 +0,0 @@
#!/usr/bin/env sh
polybar-msg hook spotifyd 1

View File

@ -44,7 +44,7 @@ font-1 = "Hack Nerd Font:style=Regular:pixelsize=10;2"
modules-left = i3 modules-left = i3
modules-center = modules-center =
modules-right = spotifyd pulseaudio memory cpu wlan wireguard-status battery date modules-right = playerctl pulseaudio memory cpu wlan wireguard-status battery date
tray-position = right tray-position = right
tray-padding = 2 tray-padding = 2
@ -197,15 +197,16 @@ format-full-foreground = ${colors.text}
format-full-prefix-foreground = ${colors.foreground} format-full-prefix-foreground = ${colors.foreground}
format-full-underline = ${self.format-charging-underline} format-full-underline = ${self.format-charging-underline}
[module/spotifyd] [module/playerctl]
type = custom/ipc type = custom/script
exec = $XDG_CONFIG_HOME/polybar/playerctl-meta.sh
tail = true
format-foreground = ${colors.text} format-foreground = ${colors.text}
format-underline = ${colors.spotify-ul} format-underline = ${colors.spotify-ul}
hook-0 = $HOME/.config/polybar/spotifyd-meta.sh
initial = 1
[module/wireguard-status] [module/wireguard-status]
type = custom/ipc type = custom/ipc

View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
playerctl --player=spotify,%any -f "{{title}} - {{artist}}" metadata -F 2>/dev/null

View File

@ -1,16 +0,0 @@
#!/usr/bin/env sh
meta(){
metadata=$(playerctl --player=spotify,%any -f "{{title}} - {{artist}}" metadata 2>/dev/null ) && echo $metadata
}
i=0
until meta || [ $i -gt 10 ];
do
sleep 1
let i=i+1
done
exit $?