From f6a539677ef9ab98c25220174c2162ca375d15d0 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 7 Mar 2026 13:00:34 -0600 Subject: fix: update layout-resize and waybar-netspeed for 0.54 layout-resize: replace removed splitratio dispatcher with layoutmsg mfact for master layout resizing. waybar-netspeed: replace iwgetid/proc/net/wireless with iw commands for SSID and signal strength (old tools no longer populated by kernel). --- dotfiles/hyprland/.local/bin/layout-resize | 4 ++-- dotfiles/hyprland/.local/bin/waybar-netspeed | 27 +++++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'dotfiles') diff --git a/dotfiles/hyprland/.local/bin/layout-resize b/dotfiles/hyprland/.local/bin/layout-resize index c7e0151..70742c5 100755 --- a/dotfiles/hyprland/.local/bin/layout-resize +++ b/dotfiles/hyprland/.local/bin/layout-resize @@ -16,9 +16,9 @@ case "$LAYOUT" in *) # master, dwindle, etc. if [ "$DIR" = "grow" ]; then - hyprctl dispatch splitratio 0.05 + hyprctl dispatch layoutmsg mfact 0.05 else - hyprctl dispatch splitratio -0.05 + hyprctl dispatch layoutmsg mfact -0.05 fi ;; esac diff --git a/dotfiles/hyprland/.local/bin/waybar-netspeed b/dotfiles/hyprland/.local/bin/waybar-netspeed index a6296b0..c285ac5 100755 --- a/dotfiles/hyprland/.local/bin/waybar-netspeed +++ b/dotfiles/hyprland/.local/bin/waybar-netspeed @@ -39,22 +39,25 @@ DOWN=$(format_speed $RX_RATE) # Determine connection type and get appropriate icon/label if [ -d "/sys/class/net/$INTERFACE/wireless" ]; then # WiFi connection - LABEL=$(iwgetid -r 2>/dev/null || echo "WiFi") + LABEL=$(iw dev "$INTERFACE" info 2>/dev/null | awk '/ssid/ {print $2}') + [ -z "$LABEL" ] && LABEL="WiFi" - # Get signal strength in percentage - SIGNAL=$(awk 'NR==3 {print int($3 * 100 / 70)}' /proc/net/wireless 2>/dev/null) + # Get signal strength in dBm + SIGNAL_DBM=$(iw dev "$INTERFACE" link 2>/dev/null | awk '/signal:/ {print $2}') - # Select icon based on signal strength - if [ -z "$SIGNAL" ] || [ "$SIGNAL" -le 0 ]; then + # Select icon based on signal dBm + if [ -z "$SIGNAL_DBM" ]; then ICON="󰤯" # No signal - elif [ "$SIGNAL" -le 25 ]; then - ICON="󰤟" # Weak - elif [ "$SIGNAL" -le 50 ]; then - ICON="󰤢" # Fair - elif [ "$SIGNAL" -le 75 ]; then + elif [ "$SIGNAL_DBM" -ge -50 ]; then + ICON="󰤨" # Excellent + elif [ "$SIGNAL_DBM" -ge -60 ]; then ICON="󰤥" # Good + elif [ "$SIGNAL_DBM" -ge -70 ]; then + ICON="󰤢" # Fair + elif [ "$SIGNAL_DBM" -ge -80 ]; then + ICON="󰤟" # Weak else - ICON="󰤨" # Excellent + ICON="󰤯" # No signal fi else # Ethernet connection @@ -64,4 +67,4 @@ fi TOOLTIP="Up: $UP\nDown: $DOWN" -echo "{\"text\": \"$ICON $LABEL\", \"tooltip\": \"$TOOLTIP\", \"class\": \"connected\"}" +echo "{\"text\": \"$ICON $LABEL\", \"tooltip\": \"$TOOLTIP\", \"class\": \"connected\"}" -- cgit v1.2.3