7

I have installed Ubuntu 18.04 with Unity using the mini ISO. So I don't have GNOME installed with Unity. My problem is that keyboard shortcuts (e.g., launching Terminal or switching between keyboard layouts) don't work. Searching online, some have suggested to add sleep 2 before launching compiz in /usr/lib/systemd/user/unity7.service. This worked once but after I rebooted it didn't work anymore. Others have suggested to toggle Commands in CompizConfig Settings Manager. This works but I have to redo it every time I log out. Is there any permanent solution to this? This is really irritating.

Update: Apparently, this is a bug according to this link.

2 Answers 2

10

Edit / tldr:

This ppa fixes this bug:

sudo add-apt-repository ppa:unity7maintainers/unity7-desktop
sudo apt-get update
reboot

The following script toggles the commands plugin automatically:

#!/bin/bash
export DISPLAY=:0
activeplugins=$(dconf read /org/compiz/profiles/unity/plugins/core/active-plugins)
found=$(echo "$activeplugins" | grep commands)
echo "$found"
if [ -z "$found" ] ; then
    activeplugins=$(echo "$activeplugins" | sed -r "s/animation', /animation', 'commands', /")
else
    activeplugins=$(echo "$activeplugins" | sed -r "s/'commands', //" | sed -r "s/, 'commands'//")
fi
echo "$activeplugins"
dconf write /org/compiz/profiles/unity/plugins/core/active-plugins "$activeplugins"

You can add this script to your startup applications to execute it automatically at login. However if you lock your screen then unlock it, your custom keyboard shortcuts won't work again.

To fix this you must listen for lock/unlock events as described here and add this script into the unlock section of that script, eg after echo "Screen unlocked"

Also note that the order of the active plugins is important: I inserted the 'commands' plugin after 'animation' which was enabled for me. If 'animation' is not enabled for you, then it must be inserted after the first active plugin when 'commands' is in its usual position.

3
  • I've switched back to 16.04, so I cannot check and see if adding the ppa works. But thanks anyways! Hopefully, it'll help others with the same problem.
    – smz
    Nov 19, 2018 at 1:35
  • This worked for me! You can't imagine how happy I am after running into many issues upgrading to 18. Jan 7, 2019 at 5:43
  • This is a lifesaver indeed! I lost all my shortcuts after upgrading to 18.04 and sticking with Unity. This revived my complete Antique Microsoft Wireless Multimedia Keyboard :-)
    – fregger
    May 16, 2019 at 23:38
1

The best solution is to "modify or disable the HUD's use of the 'Alt key'".

So go to settings -> shortcuts -> launchers -> key to show the HUD and change ALT to Super ( windows image) for example.

After this change and reboot shortcuts work like a charm!

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .