Setting a HotKey to Toggle the WiFi On/Off (Alternative to the Fn+F2 switch)

First, we create a script (for ease of use, and so that we can toggle it on/off using the same hotkey) -Copy-paste the contents of the above box in a text file and save this file in your Home directory with the name - "". Make sure the first line is (without double quotes) "" and last one is "".Make the script executable by running the following command in a terminal -Run the following command to Create a symlink to this script in /bin directory -

Code: sudo apt-get install xbindkeys-config

Code: xbindkeys --defaults > ~/.xbindkeysrc

Code: xbindkeys-config

New

Name

Get Key

Action

Code: /bin/bash /bin/wifitoggle.sh

Apply

Save & Apply & Exit

Install(a GUI frontend to xbindkeys - the program that captures and binds hotkeys with commands) -Create a default config file for it (else it would crash on key capture step) -Run the program from terminal or "Alt+F2" (because it does not create a launcher in Unity dash) -let the terminal running in the background..In the GUI box that opens, 3 example shortcuts are already present. You may leave them.Click on "" button at the bottom of the GUI.In the right hand pane of the GUI, fill in a suitable name in the "" field, e.g. "Click on "" button. This will open a tiny blank box doing nothing but waiting for your input.Press the desired key (or key combination) that you want for toggling Wifi on/off. For example, "F3" key (as it remains mostly unused). The tiny box will disappear and the key will be recorded.In the "" field, type this -Click on "" button and test the hotkey to see if it works as expected.Click on "" to save the new hotkey to the default file and exit.