feat(eww): add airplane mode to qs buttons
This commit is contained in:
parent
57b75324d4
commit
3122d6ae25
3 changed files with 28 additions and 5 deletions
|
@ -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")
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue