diff options
author | sefidel <contact@sefidel.net> | 2023-09-16 11:45:57 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2023-09-16 11:45:57 +0900 |
commit | c7a6272a94873522289af6f7164c0773a1aa8838 (patch) | |
tree | 859139ca0d6390dc593e7e1d3de2bb89d7eb23ca /home/profiles/gui/scripts | |
parent | 3a6532797122d4acca1c0bbe420a9f5ee90af813 (diff) | |
download | nixrc-c7a6272a94873522289af6f7164c0773a1aa8838.tar.gz nixrc-c7a6272a94873522289af6f7164c0773a1aa8838.zip |
feat(home/gui): fix multimedia keys
Diffstat (limited to 'home/profiles/gui/scripts')
-rw-r--r-- | home/profiles/gui/scripts/aeroplane-mode.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/home/profiles/gui/scripts/aeroplane-mode.nix b/home/profiles/gui/scripts/aeroplane-mode.nix new file mode 100644 index 0000000..9f09c05 --- /dev/null +++ b/home/profiles/gui/scripts/aeroplane-mode.nix @@ -0,0 +1,15 @@ +'' +set -euo pipefail + +rfkill_soft=$(rfkill -ro soft | tail -n +2 | sort -u) + +rfkill toggle all + +if [[ $rfkill_soft == "unblocked" ]]; then + notify-send --urgency=critical "Aeroplane mode ACTIVATED" +elif [[ $rfkill_soft == "blocked" ]]; then + notify-send --urgency=critical "Aeroplane mode DEACTIVATED" +else + notify-send --urgency=critical "WARN: RFKill was in inconsistent state. Aeroplane mode ACTIVATED" +fi +'' |