?

Log in

No account? Create an account
entries friends calendar profile Elf Sternberg's Pendorwright Projects Previous Previous Next Next
Airplane Mode from the Ubuntu Terminal - Elf M. Sternberg
elfs
elfs
Airplane Mode from the Ubuntu Terminal

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 airplay four score and seven years ago will turn it back on. Any argument is accepted as turning airplane mode off. Even airplane on.)

4 comments or Leave a comment
Comments
casualprofessor From: casualprofessor Date: January 16th, 2014 07:58 pm (UTC) (Link)
What about Fn-F5?
elfs From: elfs Date: January 18th, 2014 05:16 am (UTC) (Link)
Doesn't seem to work on my machine. Besides, that's actually an alien set of keystrokes to me, whereas a CLI tool is just me happily typing along on an interface I'm already friends with.
nojay From: nojay Date: January 17th, 2014 12:19 am (UTC) (Link)
I get "Wifi available" popups appear when a bus drives past our front window -- the express coaches have "Free Wifi" stickers on the side (a bit like "Free Mumia" T-shirts), basically a 3G mobile connection serving an on-board WAP. I used to get popups from trains stopped at the platforms in the station across the street (same 3G/WAP deal) but they rebuilt the station and that has blocked my line-of-sight to the platforms so no more "trains"itory wifi for me.
elfs From: elfs Date: January 18th, 2014 05:16 am (UTC) (Link)
Heh, I see what you did there.
4 comments or Leave a comment