The Global Menu is a Unity feature that was introduced to save some vertical space when using screens with limited vertical space such as Netbooks. However, despite its advantages on small screens, the Global Menu remains controversial. 

The Global Menu supports both Qt and GTK+ applications. However, this feature might not work properly in some rare cases (especially with Qt applications), so you may want to disable it for just one application instead of removing it completely.

Disable the Global Menu for a particular Qt/KDE application:

In this example, we will add a Unity Quicklist entry to start Clementine without the Global Menu:


To enable this Quicklist entry, we need to edit the .desktop file of the application (Clementine in our case).
The .desktop files are usually located in the following directory:
/usr/share/applications

In order to edit the .desktop file of Clementine, type the following commands in a terminal window:

cd /usr/share/applications
gksudo vim clementine.desktop

The aforementioned commands will open the Clementine .desktop file in your favorite text editor (For instance, to use Gedit, replace vim with gedit).
To add the No Global Menu Quicklist entry, append the following lines to the end of the .desktop file:

[NoGM Shortcut Group]
Name=No Global Menu
Exec=env QT_X11_NO_NATIVE_MENUBAR=1 clementine
TargetEnvironment=Unity

Locate the following line in the .desktop file:
X-Ayatana-Desktop-Shortcuts=Play;Pause;Stop;Previous;Next;

Then change it to:
X-Ayatana-Desktop-Shortcuts=Play;Pause;Stop;Previous;Next;NoGM;

Notice that the word we have appended to this line (NoGM) must match the word contained in the first line of the previous code block:

[NoGM Shortcut Group]

Save the file, and then click on the newly added Quicklist entry to test your configuration.

How does it work?

We will explain the following code in more details:

[NoGM Shortcut Group]
Name=No Global Menu
Exec=env QT_X11_NO_NATIVE_MENUBAR=1 clementine
TargetEnvironment=Unity


Name is the name of the Quicklist entry.

Exec=env QT_X11_NO_NATIVE_MENUBAR=1 clementine is the command that will be executed when the Quicklist entry is clicked. QT_X11_NO_NATIVE_MENUBAR=1 is the environment variable that disables the Global Menu.

To disable the Global Menu for a GTK+ application, replace:
Exec=env QT_X11_NO_NATIVE_MENUBAR=1

with:

Exec=env UBUNTU_MENUPROXY=1

Comments