Ubuntu – Can I create a keyboard shortcut to kicking on the WiFi hotspot


How might I create a keyboard shortcut for turning on my WiFi hotspot?

I tried using the keyboard shortcut menu in the settings, with nmcli device wifi hotspot ssid ____ password ____ for turning on the hotspot and nmcli device disconnect _____ for turning it off.

But that didn't seem to work.

Best Answer

First step would be to create scripts to connect and disconnect WiFi hotspot. See this Q&A for options: How to connect to WiFi from the command line?

To see list of available WiFi hotspots ()

nmcli d wifi list

Sample Script to connect:

nmcli d connect <WifiInterface>

Sample Script to disconnect:

nmcli d disconnect <WifiInterface>

Marks the scripts as executable with chmod:

sudo chmod a+x /path/to/script-name

Assign shortcut keys to scripts: How do I setup keyboard macros?

NOTE: Have your password automatically saved with your WiFi profile so it doesn't have to be reentered every time it is started up.