summaryrefslogtreecommitdiff
path: root/home-config/waybar/modules
diff options
context:
space:
mode:
Diffstat (limited to 'home-config/waybar/modules')
-rwxr-xr-xhome-config/waybar/modules/check-for-music.sh7
-rwxr-xr-xhome-config/waybar/modules/spotify.sh8
2 files changed, 11 insertions, 4 deletions
diff --git a/home-config/waybar/modules/check-for-music.sh b/home-config/waybar/modules/check-for-music.sh
new file mode 100755
index 0000000..3b735a2
--- /dev/null
+++ b/home-config/waybar/modules/check-for-music.sh
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3if [[ $(playerctl metadata --format '{{lc(status)}}' | grep playing) -eq 0 ]]; then
4 exit 0
5else
6 exit 1
7fi
diff --git a/home-config/waybar/modules/spotify.sh b/home-config/waybar/modules/spotify.sh
index a75136c..3368d88 100755
--- a/home-config/waybar/modules/spotify.sh
+++ b/home-config/waybar/modules/spotify.sh
@@ -1,12 +1,12 @@
1#!/bin/sh 1#!/bin/sh
2 2
3class=$(playerctl metadata --player=spotifyd --format '{{lc(status)}}') 3class=$(playerctl metadata --format '{{lc(status)}}')
4icon="" 4icon="󰽴"
5 5
6if [[ $class == "playing" ]]; then 6if [[ $class == "playing" ]]; then
7 info=$(playerctl metadata --player=spotifyd --format '{{artist}} - {{title}}') 7 info=$(playerctl metadata --format '{{artist}} - {{title}}')
8 if [[ ${#info} > 40 ]]; then 8 if [[ ${#info} > 40 ]]; then
9 info=$(echo $info | cut -c1-40)"..." 9 info=$(playerctl metadata --format '{{title}}' | cut -c1-40)"..."
10 fi 10 fi
11 text=$info" "$icon 11 text=$info" "$icon
12elif [[ $class == "paused" ]]; then 12elif [[ $class == "paused" ]]; then