aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/AirplaneMode.sh
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2023-12-29 15:44:57 +0900
committerGitHub <noreply@github.com>2023-12-29 15:44:57 +0900
commit2c070b5bfb2de84abed8a4cd45e999999021db38 (patch)
treeab297f40d72eab1dad7506e005cec1654f942ff6 /config/hypr/scripts/AirplaneMode.sh
parent76672ae5a6ac03c416bc705d51dec363f88b7a40 (diff)
parent69772de8b00a85a7da8e3d56c802fcfd01affe1c (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-xconfig/hypr/scripts/AirplaneMode.sh16
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage