Install compizconfig-settings-manager . Search for "compiz" in the Unity Dash, or start with ccsm
from the commandline.
Warning
CompizConfig Settings Manager (ccsm
) is an advanced tool, and not all of its options are completely compatible with Unity.
As such, CCSM has been known to sometimes break users'
desktops. Please use caution and
know that you are taking a risk by following this answer or any other
answer that recommends the use of CCSM. In the event that following
this advice does break Unity, please see this
question for instructions on how
to reset it.
Find the Grid plugin:
Click on the key binding you want to change, click on Grab key combination, and press the keys you'd like to use.
The terms we are discussing here are "keyboard shortcuts" and "keybindings". They are useful when searching for help.
First, run xev
in a terminal to see if the key works.
If it works, open Settings > Devices > Keyboard for a list of shortcuts. If it says Alt without specifying right or left they should both work. Replace any that specify a side and make sure it only says Alt.
If you have trouble making the settings do that, install dconf-editor
sudo apt install dconf-editor
and launch it from the terminal
dconf-editor
Locate the search icon and type keybinding
and look through the paths for what you need. In your example navigate to
org/gnome/desktop/vm/keybindings/close
If the default value is on it should be set to
['<Alt>F4']
If it's not, switch default to off and enter exactly the above as a custom entry.
My Alt shortcuts seem to be the same for each side, so maybe yours got reconfigured somehow.
Best Answer
Ubuntu 18.04 dropped support for the Unity desktop compositor in favour of GNOME Shell. GNOME Shell is incompatible with Compiz. You need to look for a method to replicate this behaviour using GNOME Shell and its extensions or install and use an unofficial, community-supported version of Unity.
P.S.: There's a follow-up question with a suggestion for a replacement GNOME Shell extension.