add basic userscript for airplanemode v2 APPLIED

Aljoscha Hartmann: 1
 add basic userscript for airplanemode

 2 files changed, 21 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~anjan/public-inbox/patches/48231/mbox | git am -3
Learn more about email & git

[PATCH v2] add basic userscript for airplanemode Export this patch

This should fix the missing file in the first version.

 scripts/README.md        |  5 +++++
 scripts/airplane_mode.sh | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100755 scripts/airplane_mode.sh

diff --git a/scripts/README.md b/scripts/README.md
index 6fef6cd..9e1249b 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -109,3 +109,8 @@ Copy the script to `$XDG_CONFIG_HOME/sxmo/userscripts` and make it executable.
- Author: Peter Thomason <pthom44@live.com.au>
- Licence: GPL3+
- Description: Modified sxmo_weather.sh to include worldwide support. This supports current location and future forcasts.

## airplane_mode.sh
- Author: Aljoscha Hartmann
- License: GPL3+
- Descripton: Small script that calls nmcli radio off/on respectively for "Airplane Mode".
diff --git a/scripts/airplane_mode.sh b/scripts/airplane_mode.sh
new file mode 100755
index 0000000..5ea3474
--- /dev/null
+++ b/scripts/airplane_mode.sh
@@ -0,0 +1,16 @@
# Author: Aljoscha Hartmann <aljoscha.hartmann@posteo.de>
# Currently this script doesn't support turning of bluetooth, as I don't use bluetooth myself. Feel free to add a line for bluetooth anytime!
# License GPL3+

# title="$icon_net Airplane Mode"

radio="$(nmcli radio all | awk 'FNR == 2 {print $2}')"
if [ "$radio" == "enabled" ]
  nmcli radio all off
  notify-send "Airplane mode is ON"
 nmcli radio all on
 notify-send "Airplane mode is OFF"

To git@git.sr.ht:~anjan/sxmo-userscripts
   408e5a8..a0e38db  master -> master