summaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles')
-rwxr-xr-xdotfiles/hyprland/.local/bin/layout-resize4
-rwxr-xr-xdotfiles/hyprland/.local/bin/waybar-netspeed27
2 files changed, 17 insertions, 14 deletions
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\": \"<span size='large'>$ICON</span> $LABEL\", \"tooltip\": \"$TOOLTIP\", \"class\": \"connected\"}"
+echo "{\"text\": \"<span size='large'>$ICON</span> $LABEL\", \"tooltip\": \"$TOOLTIP\", \"class\": \"connected\"}"