From f9f087f055dcca066b74da159a448ed227f26e7e Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Thu, 7 Sep 2023 23:50:02 -0400 Subject: added music info to waybar --- home-config/waybar/modules/check-for-music.sh | 7 +++++++ home-config/waybar/modules/spotify.sh | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100755 home-config/waybar/modules/check-for-music.sh (limited to 'home-config/waybar/modules') 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 @@ +#!/bin/sh + +if [[ $(playerctl metadata --format '{{lc(status)}}' | grep playing) -eq 0 ]]; then + exit 0 +else + exit 1 +fi 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 @@ #!/bin/sh -class=$(playerctl metadata --player=spotifyd --format '{{lc(status)}}') -icon="" +class=$(playerctl metadata --format '{{lc(status)}}') +icon="󰽴" if [[ $class == "playing" ]]; then - info=$(playerctl metadata --player=spotifyd --format '{{artist}} - {{title}}') + info=$(playerctl metadata --format '{{artist}} - {{title}}') if [[ ${#info} > 40 ]]; then - info=$(echo $info | cut -c1-40)"..." + info=$(playerctl metadata --format '{{title}}' | cut -c1-40)"..." fi text=$info" "$icon elif [[ $class == "paused" ]]; then -- cgit v1.2.3