fix(waybar): better wifi disconnect tooltip
This commit is contained in:
parent
ed6497419f
commit
4972396c22
2 changed files with 3 additions and 13 deletions
|
|
@ -150,8 +150,8 @@ in
|
||||||
tooltip = true;
|
tooltip = true;
|
||||||
tooltip-format-wifi = "SSID: {essid}\nDown: {bandwidthDownBits}\nUp: {bandwidthUpBits}\nIP: {ipaddr}";
|
tooltip-format-wifi = "SSID: {essid}\nDown: {bandwidthDownBits}\nUp: {bandwidthUpBits}\nIP: {ipaddr}";
|
||||||
tooltip-format-ethernet = "{ifname} · {ipaddr}";
|
tooltip-format-ethernet = "{ifname} · {ipaddr}";
|
||||||
tooltip-format-disconnected = "disconnected";
|
tooltip-format-disconnected = "Wireless LAN disconnected";
|
||||||
on-click = "ctl wifi toggle";
|
on-click = "rfkill toggle wlan";
|
||||||
on-click-right = "ctl wifi pick";
|
on-click-right = "ctl wifi pick";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
12
scripts/ctl
12
scripts/ctl
|
|
@ -159,16 +159,6 @@ volume)
|
||||||
;;
|
;;
|
||||||
wifi)
|
wifi)
|
||||||
case "$2" in
|
case "$2" in
|
||||||
toggle)
|
|
||||||
require notify-send
|
|
||||||
rfkill toggle wifi
|
|
||||||
sleep 0.5
|
|
||||||
if rfkill list wifi | grep -q 'Soft blocked: yes'; then
|
|
||||||
notify-send -a ctl -t 2500 -r 5557 " wifi disconnected"
|
|
||||||
else
|
|
||||||
notify-send -a ctl -t 2500 -r 5557 " wifi connected"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
pick)
|
pick)
|
||||||
require fuzzel
|
require fuzzel
|
||||||
station=$(iwctl device list 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | awk '/station/{print $1}')
|
station=$(iwctl device list 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | awk '/station/{print $1}')
|
||||||
|
|
@ -189,7 +179,7 @@ wifi)
|
||||||
iwctl station "$station" connect "$ssid"
|
iwctl station "$station" connect "$ssid"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ctl wifi {toggle|pick}" >&2
|
echo "Usage: ctl wifi {pick}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue