How to set a shortcut for "Always on Top" for window?

It should work on every Ubuntu OS since version 9.04 without installing anything, modifying of creating any shortcuts.

Try Alt + Space, T

  • Alt + Space as the first shortcut brings up the right-click mouse menu

  • T selects the "Always On Top" function.


Since no one has mentioned this yet, I'll just leave a solution that worked for me on Ubuntu 12.04.

You could setup a regular keyboard shortcut and use wmctrl to toggle the "Always on Top" option.

Go to System Settings > Keyboard > Shortcuts > Custom Shortcuts. Hit the + and give your shortcut a name. Then enter the following command.

wmctrl -r :ACTIVE: -b toggle,above

If you don't have it already, you can install wmctrl from the repos using

sudo apt-get install wmctrl

You should have something that looks similar to this.

Screenshot showing a custom keyboard shortcut setup screen

Hit apply and you should be good to go!

This solution came from a discussion on Ubuntu forums.


Unity instead of GNOME (Ubuntu before 17.04)

If not install CCSM and extra compiz plugins via:

sudo apt-get install compizconfig-settings-manager compiz-plugins-extra

Be aware please. CCSM can kill Unity3D on some systems.

If you have not had compiz-plugins-extra already installed, you need to restart Compiz to load them (even though they display in CCSM just fine before the restart) with Alt+F2 and

compiz --replace

You can see Extra WM Actions under Windows Management section on CCSM as explained in the post you found. You can set the desired action there easily.