From c7a6272a94873522289af6f7164c0773a1aa8838 Mon Sep 17 00:00:00 2001 From: sefidel Date: Sat, 16 Sep 2023 11:45:57 +0900 Subject: feat(home/gui): fix multimedia keys --- home/profiles/gui/scripts/aeroplane-mode.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 home/profiles/gui/scripts/aeroplane-mode.nix (limited to 'home/profiles/gui/scripts/aeroplane-mode.nix') 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 +'' -- cgit 1.4.1