diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2023-12-29 15:44:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-29 15:44:57 +0900 |
| commit | 2c070b5bfb2de84abed8a4cd45e999999021db38 (patch) | |
| tree | ab297f40d72eab1dad7506e005cec1654f942ff6 /config/hypr/scripts/AirplaneMode.sh | |
| parent | 76672ae5a6ac03c416bc705d51dec363f88b7a40 (diff) | |
| parent | 69772de8b00a85a7da8e3d56c802fcfd01affe1c (diff) | |
Merge pull request #106 from JaKooLit/development
Development to Main for v2.2.2 Changes
Diffstat (limited to 'config/hypr/scripts/AirplaneMode.sh')
| -rwxr-xr-x | config/hypr/scripts/AirplaneMode.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/config/hypr/scripts/AirplaneMode.sh b/config/hypr/scripts/AirplaneMode.sh index 428a09bd..f3a50629 100755 --- a/config/hypr/scripts/AirplaneMode.sh +++ b/config/hypr/scripts/AirplaneMode.sh @@ -1,12 +1,14 @@ #!/bin/bash -dunst_notif="$HOME/.config/dunst/images/bell.png" +notif="$HOME/.config/swaync/images/bell.png" -wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')" -if [ "$wifi" == "enabled" ]; then - rfkill block all & - dunstify -u normal -i "$dunst_notif" -t 1000 'airplane mode: active' +# 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 unblock all & - dunstify -u normal -i "$dunst_notif" -t 1000 'airplane mode: inactive' + rfkill block wifi + notify-send -u low -i "$notif" 'Airplane mode: ON' fi |
