summaryrefslogtreecommitdiff
path: root/.local/bin/statusbar/player_mpris_module
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/statusbar/player_mpris_module')
-rwxr-xr-x.local/bin/statusbar/player_mpris_module21
1 files changed, 13 insertions, 8 deletions
diff --git a/.local/bin/statusbar/player_mpris_module b/.local/bin/statusbar/player_mpris_module
index 3701cbf..fef6bb8 100755
--- a/.local/bin/statusbar/player_mpris_module
+++ b/.local/bin/statusbar/player_mpris_module
@@ -1,15 +1,20 @@
#!/bin/sh
+# This is a static status module, for a dynamic one, there is the option
+# with zscroll.
+
+icon=" "
+
show_panel (){
# Needs to send to /dev/null for the actual else case.
player_status=$(playerctl status 2> /dev/null)
if [ "$player_status" = "Playing" ]; then
- echo " $(playerctl metadata artist) - $(playerctl metadata title)"
+ echo "$icon $(playerctl metadata artist) - $(playerctl metadata title)"
elif [ "$player_status" = "Paused" ]; then
- echo "%{F$(xresource color8)} $(playerctl metadata artist) - $(playerctl metadata title)%{F-}"
+ echo "%{F$(xresource color8)}$icon $(playerctl metadata artist) - $(playerctl metadata title)%{F-}"
else
- echo "%{F$(xresource color8)} (nothing playing)"
+ echo "%{F$(xresource color8)}$icon (nothing playing)"
fi
}
@@ -21,9 +26,9 @@ send_notification (){
title="$(playerctl metadata title)"
if [ $album = "\n"]; then
- notify-send " $artist - $album" "$title"
+ notify-send "$icon $artist - $album" "$title"
else
- notify-send " $artist" "$title"
+ notify-send "$icon $artist" "$title"
fi
elif [ "$player_status" = "Paused" ]; then
artist="$(playerctl metadata artist)"
@@ -31,12 +36,12 @@ send_notification (){
title="$(playerctl metadata title)"
if [ $album = "\n"]; then
- notify-send " (Paused) $artist - $album" "$title"
+ notify-send "$icon (Paused) $artist - $album" "$title"
else
- notify-send " (Paused) $artist" "$title"
+ notify-send "$icon (Paused) $artist" "$title"
fi
else
- notify-send " Nothing playing"
+ notify-send "$icon Nothing playing"
fi
}