~mil/sxmo-utils

3f5746a47ceb2ba057ed1515ddb2f714500f6f90 — Peter John Hartman 2 months ago b20dd10
wifitoggle: also update statusbar

I was surprised to see that the wifi icon didn't disappear when I
toggled wifi off.  After some debugging, it seems that the trigger
to update the status bar on network down doesn't get triggered when we
rfkill in time, so I fake a trigger in the toggle.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
1 files changed, 9 insertions(+), 3 deletions(-)

M configs/default_hooks/sxmo_hook_contextmenu.sh
M configs/default_hooks/sxmo_hook_contextmenu.sh => configs/default_hooks/sxmo_hook_contextmenu.sh +9 -3
@@ 81,9 81,15 @@ case "$WMCLASS" in
				printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
			)
			$icon_wif Wifi $(
				rfkill list wifi | grep -q "yes" &&
				printf %b "$icon_tof" ||  printf %b "$icon_ton";
				printf %b "^ 1 ^ doas sxmo_wifitoggle.sh"
				if rfkill list wifi | grep -q "yes"; then
					printf %b "$icon_tof"
					printf %b "^ 1 ^ doas sxmo_wifitoggle.sh"
				else
					printf %b "$icon_ton"
					# fake trigger to update status bar
					devicename="$(nmcli -t c show --active | grep '802-11-wireless' | cut -d':' -f4)"
					printf %b "^ 1 ^ doas sxmo_wifitoggle.sh && sxmo_hook_statusbar.sh network wifi \"$devicename\""
				fi
			)
			$(test "$SXMO_WM" = dwm && printf %b "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
			$icon_clk Change Timezone            ^ 1 ^ sxmo_timezonechange.sh