Files
hyprland/config/hypr/scripts/AirplaneMode.sh
T
2024-01-01 20:27:57 +05:45

16 lines
420 B
Bash
Executable File

#!/bin/bash
# Airplane Mode. Turning on or off all wifi using rfkill.
notif="$HOME/.config/swaync/images/bell.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