Ubuntu / Linux news and application reviews.

Unity Dash on top of fullscreen game

In Ubuntu (Unity), the Super (Windows) key is used to open Unity Dash. Accidentally pressing the Super key when playing fullscreen games can be quite annoying, because Dash covers quite a bit of the screen, so you can't see what's going on, and it also switches the keyboard input from the game to Unity.

If you've gotten used to using the Super key to open Dash and don't want to change it, you can use a Python script, created by Sergiy Kolodyazhnyy for AskUbuntu, which automatically disables the Super key from opening Unity Dash, if there are any fullscreen windows. Note that the script has only been tested in Ubuntu 16.04.

The script does not disable Super key combinations, so for instance, Super + L will continue to lock the screen, etc. Only opening the Dash is disabled, which is triggered by pressing the Super key alone.

You can check out the script code HERE.

To download the script and install it in /usr/local/bin, use the following commands:
sudo apt install wget
wget http://raw.githubusercontent.com/SergKolo/sergrep/master/disable_super_key.py -O /tmp/disable_super_key.py
sudo install /tmp/disable_super_key.py /usr/local/bin/

Update: since the Alt key triggers the HUD by default, which causes the same issues as the Dash, I modified Sergiy's Python script to also disable the Alt key (only for opening HUD) while there are fullscreen windows. You can check out the script code HERE.

To install the modified script that disables both Alt and Super keys from opening Dash and Hud when a fullscreen window is focused, use the following commands:
sudo apt install wget
wget https://raw.githubusercontent.com/hotice/webupd8/master/disable_super_key.py -O /tmp/disable_super_key.py
sudo install /tmp/disable_super_key.py /usr/local/bin/

Once installed, you'll need to add the script to startup.


To do this, open Startup Applications from Unity Dash, click "Add", enter anything you want under "Name", and for "Command", use:
/usr/local/bin/disable_super_key.py
If you've installed it in a different location, click "Browse" and select the disable_super_key.py script. That's it!

Note that in my test, I had to add a delay to start the script 5 seconds after logging in, or else the script failed to start. For how to delay startup applications, see THIS article.

If you prefer to change the Dash keyboard shortcut, so it doesn't uses the Super key, install CompizConfig Settings Manager (CCSM):
sudo apt install compizconfig-settings-manager
Then open CCSM, click on Ubuntu Unity Plugin, and on the Launcher tab, assign a different shortcut for "Key to show the Dash, Launcher and Help Overlay".