diff options
| author | BardofSprites <[email protected]> | 2025-07-17 10:19:44 -0400 |
|---|---|---|
| committer | BardofSprites <[email protected]> | 2025-07-17 10:19:44 -0400 |
| commit | 3d45bf409bbd5e8575a848222ef318890e1f488e (patch) | |
| tree | 88ac7a4fed49c7304f3edcfd221df595f24b606a /bin | |
| parent | 3ce4e02a32b5e1ca26716b7d6dd9801668b35cf6 (diff) | |
change status name/class and remove plain
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/.local/bin/scripts/status-plain/music-plain | 51 | ||||
| -rwxr-xr-x | bin/.local/bin/scripts/status-plain/weather-plain | 54 | ||||
| -rwxr-xr-x | bin/.local/bin/scripts/status/internet | 2 | ||||
| -rwxr-xr-x | bin/.local/bin/scripts/status/memory | 2 | ||||
| -rwxr-xr-x | bin/.local/bin/scripts/status/weather | 2 |
5 files changed, 3 insertions, 108 deletions
diff --git a/bin/.local/bin/scripts/status-plain/music-plain b/bin/.local/bin/scripts/status-plain/music-plain deleted file mode 100755 index 60d8f4c..0000000 --- a/bin/.local/bin/scripts/status-plain/music-plain +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -# Music module script for dwmblocks - -truncate() { - echo "$1" | cut -c1-15 -} - -# Handle mouse events based on button clicks -case $BLOCK_BUTTON in - 1) # Left click to pause/play - playerctl play-pause - pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;; - 2) # Middle click to open the music player - # Replace `your-music-player` with your actual music player command - emacs-launcher "music" & ;; - 3) # Right click to show notification - notify-send "šµ Music Module -- Left click to play/pause. -- Middle click to open music player. -- Right click to show current track." ;; - 4) # Scroll up to go back - playerctl previous - pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;; - 5) # Scroll down to skip - playerctl next - pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;; -esac - -# Get current track info -artist="$(playerctl metadata artist 2>/dev/null || echo "none")" -title="$(playerctl metadata title 2>/dev/null || echo "none")" - -# Truncate artist and title to 15 characters -truncated_artist=$(truncate "$artist") -truncated_title=$(truncate "$title") - -# Format the output as "artist - title" -current_track="$truncated_artist - $truncated_title" - -playerstatus=$(playerctl status) - -case "$playerstatus" in - "Playing") icon="ó°" ;; - "Paused") icon="ļ" ;; - "Stopped") icon="ļ" ;; - "*") icon="" ;; -esac - -# Print the current track -echo "$icon $current_track" diff --git a/bin/.local/bin/scripts/status-plain/weather-plain b/bin/.local/bin/scripts/status-plain/weather-plain deleted file mode 100755 index 5de984b..0000000 --- a/bin/.local/bin/scripts/status-plain/weather-plain +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -# Displays today's precipication chance (ā), and daily low (š„¶) and high (š). -# Usually intended for the statusbar. - -url="${WTTRURL:-wttr.in}" -weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" - -# Get a weather report from 'wttr.in' and save it locally. -getforecast() { curl -sf "$url/Louisville?M" > "$weatherreport" || exit 1; } - -# Forecast should be updated only once a day. -checkforecast() { - [ -s "$weatherreport" ] && [ "$(stat -c %y "$weatherreport" 2>/dev/null | - cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] -} - -getprecipchance() { - echo "$weatherdata" | sed '16q;d' | # Extract line 16 from file - grep -wo "[0-9]*%" | # Find a sequence of digits followed by '%' - sort -rn | # Sort in descending order - head -1q # Extract first line -} - -getdailyhighlow() { - echo "$weatherdata" | sed '13q;d' | # Extract line 13 from file - grep -o "m\\([-+]\\)*[0-9]\\+" | # Find temperatures in the format "m<signed number>" - sed 's/[+m]//g' | # Remove '+' and 'm' - sort -g | # Sort in ascending order - sed -e 1b -e '$!d' # Extract the first and last lines -} - -readfile() { weatherdata="$(cat "$weatherreport")" ;} - -showweather() { - readfile - # printf "ā%s š„¶%s°C š%s°C\n" "$(getprecipchance)" $(getdailyhighlow) - printf "ī¹ %s ļ %s°C ļ
%s°C\n" "$(getprecipchance)" $(getdailyhighlow) -} - -case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -n "floatterm" -c "floatterm" -g "150x35" -e less -Sfr "$weatherreport" ;; - 2) getforecast && showweather ;; - 3) notify-send "š Weather module" "\- Left click for full forecast. -- Middle click to update forecast. -ā: Chance of rain/snow -š„¶: Daily low -š: Daily high" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -checkforecast || getforecast - -showweather diff --git a/bin/.local/bin/scripts/status/internet b/bin/.local/bin/scripts/status/internet index 5214193..371c994 100755 --- a/bin/.local/bin/scripts/status/internet +++ b/bin/.local/bin/scripts/status/internet @@ -5,7 +5,7 @@ # Show š if a vpn connection is active case $BLOCK_BUTTON in - 1) "$TERMINAL" -c "floatterm" -n "floatterm" -g "150x35" -e nmtui; pkill -RTMIN+4 dwmblocks ;; + 1) "$TERMINAL" -n "floatterm" -g "150x35" -e nmtui; pkill -RTMIN+4 dwmblocks ;; 3) notify-send "š Internet module" "\- Click to connect ā: wifi disabled š”: no wifi connection diff --git a/bin/.local/bin/scripts/status/memory b/bin/.local/bin/scripts/status/memory index 77fb96b..d620c15 100755 --- a/bin/.local/bin/scripts/status/memory +++ b/bin/.local/bin/scripts/status/memory @@ -2,7 +2,7 @@ case $BLOCK_BUTTON in 1) notify-send "š§ Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; - 2) setsid -f "$TERMINAL" -g "150x35" -c "floatterm" -n "floatterm" -e btop ;; + 2) setsid -f "$TERMINAL" -g "150x35" -n "floatterm" -e btop ;; 3) notify-send "š§ Memory module" "\- Shows Memory Used/Total. - Click to show memory hogs. - Middle click to open htop." ;; diff --git a/bin/.local/bin/scripts/status/weather b/bin/.local/bin/scripts/status/weather index 14919ae..67ae84a 100755 --- a/bin/.local/bin/scripts/status/weather +++ b/bin/.local/bin/scripts/status/weather @@ -39,7 +39,7 @@ showweather() { } case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -n "floatterm" -c "floatterm" -g "150x35" -e less -Sfr "$weatherreport" ;; + 1) setsid -f "$TERMINAL" -n "floatterm" -g "165x18" -e less ~/.cache/weather ;; 2) getforecast && showweather ;; 3) notify-send "š Weather module" "\- Left click for full forecast. - Middle click to update forecast. |
