1

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.

2 Answers2

1

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:

#!/bin/bash
nmcli d connect <WifiInterface>

Sample Script to disconnect:

#!/bin/bash
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.

0

I ended up listing these two commands in custom keyboard shortcuts in the settings.

nmcli device wifi hotspot ssid network-name password network-password

and

nmcli device disconnect ______ where ______ is something like wlp123 or something. You can get this value if you use the first command in the terminal.

Then I listed those in the keyboard shortcuts. It wasn't obvious what key combos worked and didn't work. Some combos just didn't work sadly.