You are not logged in.

#1 2016-01-01 19:26:27

ubeatlenine
Member
From: NH, USA
Registered: 2014-06-17
Posts: 8

Custom bash script to toggle airplane mode on a Clevo laptop

Hello arch community,

I have a sager NP5652 (aka clevo W650RC) laptop which I am setting up with arch. My latest endeavor has been getting airplane mode to work correctly. It doesn't work out of the box, so I have set it up myself by following the instructions on the wiki (I couldn't find the clevo-airplane-mode package in the AUR). It's very straightforward, but nonetheless I would like a sanity check on the script I have written. That is, I'd like to know whether I'm disabling bluetooth and wifi correctly, and if there's anything else I should include in the script which makes my laptop safe to use on a plane. I'm taking my laptop on a plane with me in only 2 weeks, so it would be costly for me to get this wrong yikes  Thanks!

#!/bin/sh
# toggles airplane mode
#
# this script requires root access

airplane_mode=$(cat /sys/class/leds/tuxedo::airplane/brightness)

if [ $airplane_mode == "0" ]; then
    # disable wifi
    nmcli radio wifi off

    # disable bluetooth
    systemctl stop bluetooth.service

    # turn on the airplane mode LED
    echo 1 > /sys/class/leds/tuxedo::airplane/brightness
else
    # turn off the airplane mode LED
    echo 0 > /sys/class/leds/tuxedo::airplane/brightness

    # enable bluetooth
    systemctl start bluetooth.service

    # enable wifi
    nmcli radio wifi on
fi

Offline

#2 2016-01-20 20:01:44

doggone
Member
Registered: 2013-06-19
Posts: 50

Re: Custom bash script to toggle airplane mode on a Clevo laptop

Offline

Board footer

Powered by FluxBB