diff options
-rw-r--r-- | .config/waybar/config.jsonc | 2 | ||||
-rw-r--r-- | .config/waybar/style.css | 4 | ||||
-rwxr-xr-x | .local/bin/rmpcover | 5 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-music | 21 |
4 files changed, 23 insertions, 9 deletions
diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index b965b4a..0f71823 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -2,7 +2,7 @@ "layer": "top", "position": "top", "output": "DP-2", - "height": 42, + "height": 50, "reload_style_on_change": true, "modules-left": [ "hyprland/workspaces", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 21b1b50..2b9d540 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -347,6 +347,10 @@ label:focus { border-bottom-right-radius: 0px; } +#image.empty { + opacity: 0; +} + #pulseaudio.muted { background-color: @color-widget-audio-muted-bg; color: @color-widget-audio-muted-fg; diff --git a/.local/bin/rmpcover b/.local/bin/rmpcover index 5ce77c4..0a312f6 100755 --- a/.local/bin/rmpcover +++ b/.local/bin/rmpcover @@ -1,5 +1,10 @@ #!/bin/sh +ifrunning=$(mpc status | rg -o '\[\w+\] (.*)' | awk '{print $2}') +if [ -z "$ifrunning" ]; then + echo "" +fi + prefix="/mnt/ssd/music" albumdir=$(rmpc song | jq -r '.file' | sed 's#/[^/]*$##') final=$(fd . -e jpg -e png -t f "$prefix/$albumdir/" | head -n 1) diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index 647ed8d..dfa36f1 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -4,24 +4,28 @@ filter() { artist_track="" status_icon="" modes="" - - # Flag to track if we've captured the artist and track name track_info_captured=false # Read input line by line while IFS= read -r line; do # Capture the first line with artist and track name if [ "$track_info_captured" = false ]; then + # Check if the line contains typical status info (e.g., "volume:") instead of artist-track + if echo "$line" | grep -q "volume:"; then + # No song is playing, exit with empty output + echo "" + return + fi artist_track="$line" track_info_captured=true - continue # Skip processing this line for playback modes + continue fi # Check for track status (paused or playing) if echo "$line" | grep -q "\[paused\]"; then status_icon=" " elif echo "$line" | grep -q "\[playing\]"; then - status_icon="" # Clear status_icon if playing + status_icon="" fi # Check for modes: consume, random, repeat, single @@ -37,12 +41,11 @@ filter() { if echo "$line" | grep -q "single: on"; then modes="${modes}1 " fi - done - # After all lines have been processed, output the result - if [ "$track_info_captured" = true ]; then - # Trim the trailing space from modes if any + # After all lines processed, output the result only if artist_track is valid + if [ "$track_info_captured" = true ] && [ -n "$artist_track" ]; then + # Trim trailing space from modes if any modes=$(echo "$modes" | sed 's/[[:space:]]*$//') # Only add "|" if there are modes @@ -51,6 +54,8 @@ filter() { else echo "$status_icon$artist_track" fi + else + echo "" fi } |