feat(ags): move script from eww to ags

This commit is contained in:
matt1432 2023-09-13 15:36:52 -04:00
parent e110cf19d6
commit 927f4a7ec2
2 changed files with 35 additions and 2 deletions

33
config/ags/bin/qs-toggles.sh Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
radio_status () {
radio_status=$(nmcli radio wifi)
if [[ $radio_status == "enabled" ]]; then
echo "on"
else
echo "off"
fi
}
if [[ $1 == "toggle-radio" ]]; then
stat=$(radio_status)
if [[ $stat == "on" ]]; then
nmcli radio wifi off
else
nmcli radio wifi on
fi
fi
get_state() {
if [[ "$(rfkill list | grep -A 1 hci0 | grep -o no)" == "no" ]]; then
echo " 󰂯 " > "$FILE"
else
echo " 󰂲 " > "$FILE"
fi
}
if [[ "$1" == "blue-toggle" ]]; then
rfkill toggle bluetooth
get_state
fi

View file

@ -49,7 +49,7 @@ const FirstRow = Box({
}), }),
GridButton({ GridButton({
command: () => exec("bash -c '$EWW_PATH/bluetooth.sh toggle'"), command: () => exec("bash -c '$AGS_PATH/qs-toggles.sh blue-toggle'"),
secondaryCommand: () => exec("bash -c 'blueberry &'"), secondaryCommand: () => exec("bash -c 'blueberry &'"),
icon: Icon({ icon: Icon({
className: 'grid-label', className: 'grid-label',
@ -67,7 +67,7 @@ const FirstRow = Box({
}), }),
GridButton({ GridButton({
command: () => exec('bash -c "$EWW_PATH/network.sh toggle-radio"'), command: () => exec('bash -c "$AGS_PATH/qs-toggles.sh toggle-radio"'),
secondaryCommand: () => exec("notify-send 'set this up moron'"), secondaryCommand: () => exec("notify-send 'set this up moron'"),
icon: Icon({ icon: Icon({
className: 'grid-label', className: 'grid-label',