dotfiles/.config/hypr/scripts/AirplaneMode.sh
2025-12-15 18:20:18 +01:00

16 lines
495 B
Bash
Executable file

#!/usr/bin/env bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Airplane Mode. Turning on or off all wifi using rfkill.
notif="$HOME/.config/swaync/images/ja.png"
# Check if any wireless device is blocked
wifi_blocked=$(rfkill list wifi | grep -o "Soft blocked: yes")
if [ -n "$wifi_blocked" ]; then
rfkill unblock wifi
notify-send -u low -i "$notif" " Airplane" " mode: OFF"
else
rfkill block wifi
notify-send -u low -i "$notif" " Airplane" " mode: ON"
fi