Created
July 18, 2023 16:07
-
-
Save florian-h05/09c87f043f929fb0a53db5597cbc6f9f to your computer and use it in GitHub Desktop.
Toggle airplane mode on Linux using rfkill.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Purpose: Toggle airplane mode. | |
# Usage: KDE Setting -> Shortcuts -> Add command -> Call this script "bash filename" | |
wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')" | |
if [ "$wifi" == "enabled" ] | |
then | |
rfkill block all | |
else | |
rfkill unblock all | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment