improve eww

This commit is contained in:
2026-09-10 19:54:50 +02:00
parent e551d36e1c
commit 7bb27f9373
46 changed files with 1296 additions and 1092 deletions
@@ -1,19 +1,18 @@
#!/usr/bin/env bash
is_active() {
rfkill list wifi 2>/dev/null | grep -q "Soft blocked: yes"
}
# rfkill everything (wifi + bluetooth); "active" means the wifi is soft-blocked.
active() { rfkill list wifi 2>/dev/null | grep -q "Soft blocked: yes"; }
case "$1" in
status)
is_active && echo true || echo false
;;
case ${1:-} in
status) active && echo true || echo false ;;
*)
if is_active; then
if active; then
rfkill unblock all
echo false
state=false
else
rfkill block all
echo true
state=true
fi
eww update airplane-mode="$state" 2>/dev/null
echo "$state"
;;
esac