Add spotify now playing script to polybar
This commit is contained in:
parent
c241edbeab
commit
9659eab318
2 changed files with 38 additions and 4 deletions
|
@ -55,9 +55,9 @@ font-2 = unicode:fontformat=truetype:size=8:antialias=false;0
|
|||
font-3 = SymbolsNerdFont:size=15;3
|
||||
|
||||
|
||||
modules-left = my-text-label xworkspaces
|
||||
modules-right = filesystem memory cpu battery temperature pulseaudio bluetooth wlan date
|
||||
; modules-right = xwindow filesystem pulseaudio xkeyboard memory cpu wlan eth date
|
||||
modules-left = my-text-label xworkspaces nowplaying
|
||||
modules-center =
|
||||
modules-right = filesystem memory cpu battery temperature backlight pulseaudio bluetooth wlan date
|
||||
|
||||
tray-position = right
|
||||
tray-padding = 2
|
||||
|
@ -110,9 +110,10 @@ label-volume = %percentage%%
|
|||
label-muted = "muted"
|
||||
click-right = exec pavucontrol
|
||||
label-muted-foreground = ${colors.disabled}
|
||||
label-padding = 1
|
||||
format-volume-underline = #3c4812
|
||||
format-muted-underline = ${colors.alert}
|
||||
label-volume-padding = 1
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
blacklist-0 = num lock
|
||||
|
@ -254,8 +255,30 @@ click-left = exec ~/.config/polybar/polybar_scripts/toggle_bluetooth.sh
|
|||
format-padding = 1
|
||||
format-foreground = ${colors.primary}
|
||||
format-underline = ${colors.primary}
|
||||
label-padding = 1
|
||||
|
||||
[module/backlight]
|
||||
type = internal/xbacklight
|
||||
enable-scroll = true
|
||||
format = <label>
|
||||
label = %percentage%%
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
format-underline = ${colors.primary}
|
||||
label-padding = 1
|
||||
|
||||
[module/nowplaying]
|
||||
type = custom/script
|
||||
exec = ~/dotfiles/polybar/polybar_scripts/now_playing.sh
|
||||
interval = 3
|
||||
click-left = playerctl play-pause &
|
||||
format-prefix = ""
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label-padding = 1
|
||||
format-underline = ${colors.primary}
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = true
|
||||
|
||||
|
||||
|
|
11
polybar/polybar_scripts/now_playing.sh
Executable file
11
polybar/polybar_scripts/now_playing.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
player_status=$(playerctl status 2> /dev/null)
|
||||
|
||||
if [ "$player_status" = "Playing" ]; then
|
||||
echo " $(playerctl metadata artist) | $(playerctl metadata title) | $(playerctl metadata album)"
|
||||
elif [ "$player_status" = "Paused" ]; then
|
||||
echo " $(playerctl metadata artist) | $(playerctl metadata title) | $(playerctl metadata album)"
|
||||
else
|
||||
echo "$(playerctl status)"
|
||||
fi
|
Loading…
Add table
Reference in a new issue