about summary refs log tree commit diff
path: root/home/profiles/gui/scripts/aeroplane-mode.nix
blob: 0b1ecf3d454a9d46f6e1a9a870b98c87e224576f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
''
set -euo pipefail

radio_status=$(nmcli radio | tail -n +2 | awk 'OFS="\n" {print $2,$4}' | sort -u)

if [[ $radio_status == "enabled" ]]; then
    nmcli radio all off
    notify-send --urgency=critical "Aeroplane mode ACTIVATED"
else
    nmcli radio all on
    notify-send --urgency=low "Aeroplane mode DEACTIVATED"
fi
''