fix null null in mediaplayer
This commit is contained in:
parent
a8c60290bd
commit
f56d9d6847
2
config
2
config
@ -275,8 +275,6 @@ mode "$mode_system" {
|
|||||||
}
|
}
|
||||||
bindsym $mod+Pause mode "$mode_system"
|
bindsym $mod+Pause mode "$mode_system"
|
||||||
|
|
||||||
#open audio player
|
|
||||||
exec --no-startup-id audacious
|
|
||||||
#players global horkeys
|
#players global horkeys
|
||||||
bindsym XF86AudioPrev exec playerctl previous
|
bindsym XF86AudioPrev exec playerctl previous
|
||||||
bindsym XF86AudioNext exec playerctl next
|
bindsym XF86AudioNext exec playerctl next
|
||||||
|
@ -40,6 +40,7 @@ markup=none
|
|||||||
|
|
||||||
[mediaplayer]
|
[mediaplayer]
|
||||||
label=
|
label=
|
||||||
|
command=sh /home/$USER/.config/i3/scripts/mprish.sh
|
||||||
instance=audacious
|
instance=audacious
|
||||||
interval=5
|
interval=5
|
||||||
signal=10
|
signal=10
|
||||||
|
21
scripts/mprish.sh
Normal file
21
scripts/mprish.sh
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Specifying the icon(s) in the script
|
||||||
|
# This allows us to change its appearance conditionally
|
||||||
|
|
||||||
|
player_status=$(playerctl status 2> /dev/null)
|
||||||
|
if [[ $player_status == "Playing" || $player_status == "Paused" ]]; then
|
||||||
|
metadata="$(playerctl metadata artist) - $(playerctl metadata title)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Foreground color formatting tags are optional
|
||||||
|
if [[ $player_status == "Playing" ]]; then
|
||||||
|
# Orange when playing
|
||||||
|
echo "$metadata"
|
||||||
|
elif [[ $player_status == "Paused" ]]; then
|
||||||
|
# Greyed out info when paused
|
||||||
|
echo "$metadata"
|
||||||
|
else
|
||||||
|
# Greyed out icon when stopped
|
||||||
|
echo ""
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user