Files
nixconfig/modules/home/wayland/apps/eww/bar/scripts/airplane-mode
2026-06-17 20:04:08 +02:00

20 lines
306 B
Bash

#!/usr/bin/env bash
is_active() {
rfkill list wifi 2>/dev/null | grep -q "Soft blocked: yes"
}
case "$1" in
status)
is_active && echo true || echo false
;;
*)
if is_active; then
rfkill unblock all
echo false
else
rfkill block all
echo true
fi
;;
esac