feat(eww): add airplane mode to qs buttons

This commit is contained in:
matt1432 2023-08-07 21:07:42 -04:00
parent 57b75324d4
commit 3122d6ae25
3 changed files with 28 additions and 5 deletions

View file

@ -135,9 +135,9 @@
(eventbox :class "left-part" (eventbox :class "left-part"
:cursor "pointer" :cursor "pointer"
:onclick "notify-send 'set this up moron'" :onclick "$EWW_PATH/network.sh toggle-radio"
(label :text " 󰌾 " (label :text "${network_radio == 'on' ? '󰀝 ' : '󱡻 '}"
:class "grid-label" :class "grid-label"
) )
) )
@ -247,15 +247,15 @@
(eventbox :class "left-part" (eventbox :class "left-part"
:cursor "pointer" :cursor "pointer"
:onclick "notify-send 'set this up moron'" :onclick "$HOME/.config/gtklock/scripts/lock.sh &"
(label :text " 󰍃 " (label :text " 󰌾 "
:class "grid-label" :class "grid-label"
) )
) )
(eventbox :class "right-part" (eventbox :class "right-part"
:cursor "pointer" :cursor "pointer"
:onclick "notify-send 'set this up moron'" :onclick "$EWW_PATH/open.sh powermenu"
(label :text " " :class "grid-chev") (label :text " " :class "grid-chev")
) )

View file

@ -25,3 +25,25 @@ if [[ $1 == "icon" ]]; then
get_state get_state
done done
fi fi
radio_status () {
radio_status=$(nmcli radio wifi)
if [[ $radio_status == "enabled" ]]; then
echo "on"
else
echo "off"
fi
}
if [[ $1 == "radio-status" ]]; then
radio_status
fi
if [[ $1 == "toggle-radio" ]]; then
stat=$(radio_status)
if [[ $stat == "on" ]]; then
nmcli radio wifi off
else
nmcli radio wifi on
fi
fi

View file

@ -4,6 +4,7 @@
(deflisten network_ssid "zscroll -d 0.7 -l 10 -p '. ' -u true \"$EWW_PATH/network.sh ssid\"") (deflisten network_ssid "zscroll -d 0.7 -l 10 -p '. ' -u true \"$EWW_PATH/network.sh ssid\"")
(deflisten network_icon "$EWW_PATH/network.sh icon") (deflisten network_icon "$EWW_PATH/network.sh icon")
(defpoll network_radio :interval "1s" "$EWW_PATH/network.sh radio-status")
(deflisten bluetooth_dev "zscroll -d 0.7 -l 10 -p '. ' -u true \"$EWW_PATH/bluetooth.sh device\"") (deflisten bluetooth_dev "zscroll -d 0.7 -l 10 -p '. ' -u true \"$EWW_PATH/bluetooth.sh device\"")
(deflisten bluetooth_icon "$EWW_PATH/bluetooth.sh icon") (deflisten bluetooth_icon "$EWW_PATH/bluetooth.sh icon")