ark/users/modules/eww/scripts/airplane
2022-10-22 23:54:44 +03:00

30 lines
586 B
Bash
Executable File

#!/bin/sh
icon() {
if [[ $STATUS == "no" ]]; then
echo ""
else
echo ""
fi
}
toggle() {
if [[ $STATUS == "no" ]]; then
rfkill block all
notify-send --urgency=normal -i airplane-mode-symbolic "Airplane Mode" "Airplane mode has been turned on!"
else
rfkill unblock all
notify-send --urgency=normal -i airplane-mode-disabled-symbolic "Airplane Mode" "Airplane mode has been turned off!"
fi
}
if [[ $1 == "toggle" ]]; then
toggle
else
while true; do
STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')"
icon
sleep 3;
done
fi