16Jan

Airplane Mode from the Ubuntu Terminal

Posted by Elf Sternberg as Uncategorized

I ride a bus to and from the office every day. While I love Ubuntu, getting a constant barrage of “WiFi Available” popups whenever we pass by a coffee shop is annoying as hell. Digging into the network manager every day is a chore. Solution: A simple command line handler with a memorable name:

#!/bin/bash
MODE='off'
if [[ -n "$1" ]]; then
    MODE='on'
fi
nmcli nm wifi $MODE

Typing airplane will turn off your wi-fi stack; typing airplane off will turn it back on. (Actually, typing airplane four score and seven years ago will turn it back on. Any argument is accepted as turning airplane mode off. Even airplane on.)

Comment Form

Subscribe to Feed

Categories

Calendar

January 2014
M T W T F S S
« Oct   Aug »
 12345
6789101112
13141516171819
20212223242526
2728293031