Hacking on the Slab | SUSE Communities

Hacking on the Slab


SUSE distros ship with three GNOME menus, the Slab being the default. In my opinion none of the menus get everything right. They either have too little customisation for my needs or they suffer from slightly clunky, even outright annoying, behaviour. I’ve looked at all three and ended up back with the Slab. What puts it ahead of the others is that the Application Browser has a search facility and of the three, I’ve found it to be the most hackable.

Before I go any further here’s a couple of images which show the Slab as it is by default:

The lack of a search field and differing colours are not hacks, they’re just the result of beagle not being installed and different GNOME theme being used.

Before going any further I should point out that all the customisations are done in a manner which makes them apply to all users of a machine. If in doubt, take a copy of files before modifying them.

Getting rid of the System section

An easy one to start – get rid of the System section. On the machines I manage it’s a waste of space as it tells the users nothing useful. Network information is not useful since they’re using desktops and only have one network connection. The System Monitor information is worse than useless in that it’s actually misleading. It displays the size and amount of free space in /home, but on my machines /home is a volume mounted from a file server and contains the home directories of hundreds of users. So the figures for size and free space are vastly larger than the space allocated to any one user. I don’t want users looking at that and thinking the numbers apply just to them. So I get rid of the System section.

$ gconftool-2 --direct  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type int --set /desktop/gnome/applications/main-menu/lock-down/status_area_visible false

Hacking the System list

As described in Novell’s documentation, this is done by editing the file

You can see the changes I’ve made to the System list in the before and after images at the start of the article.

On the machines I manage users don’t have root. So I’ve got rid of the YaST and Install Software icons as they’re of no use to people. Experience has shown me that having the Lock Screen button next to the Log Out button is a problem. A remarkable number of students are prone to clicking ‘Lock Screen’ by accident and don’t pay enough attention to what they’re doing to notice that they didn’t actually log out, but merely locked the screen. So the Lock Screen button has been moved. (There’s a gconf option to remove the lock screen icons but there are legitimate reasons for users to lock the screen so removing the option entirely is not reasonable.) Removing items in the System list is easy – edit system-items.xbel with your text editor of choice and delete the bookmarks you don’t want. Changing the order is no more difficult. Look for the string rank- in each bookmark’s description and alter the numbers that follow to get the order you want.

You may have noticed the spaces in between some of the items on the systems list in the images above. There are actually bookmarks with no name and a transparent icon. I first tried leaving spaces in the rank numbers, I.E. giving the bookmarks ranks of 1,2 4,6,7. But that didn’t achieve anything. The transparent icon is a 1×1 transparent png which should be placed at /usr/share/pixmaps/null.png. You can easily create this in GIMP. The tricky part to the spaces is that you cannot include a bookmark for the same item more than once. If you do, the System list displays empty. So for each space you need to create a separate .desktop entry in /usr/share/applications. I call them /usr/share/applications/null.desktop
/usr/share/applications/null1.desktop and /usr/share/applications/null2.desktop. The contents of the .desktop files is very minimal:

[Desktop Entry]

An entry for a space in system-items.xbel looks like this:

  <bookmark href="file:///usr/share/applications/null.desktop" added="2007-01-16T05:53:36Z" modified="2009-05-13T20:10:52Z" visited="2007-01-16T05:53:36Z">
    <title> </title>
      <metadata owner="http://freedesktop.org">
        <mime:mime-type type="application/x-desktop"/>
          <bookmark:application name=" " exec=" " modified="2007-01-16T05:53:36Z" count="1"/>

Remember to alter the href in each instance you add so they each refer to a different .desktop file.

Once the System list contains all the desired items you can prevent users from removing any of them. (Thus preventing them from asking how to get them back after they’ve removed something and then want it back again.)

$ gconftool-2 --direct  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type int --set /desktop/gnome/applications/main-menu/lock-down/user_modifiable_system_area false

Package add/remove

By default, right clicking on an application entry in the Slab’s Applications tab brings up a context menu that contains options to remove or upgrade that application. Like so:

As previously mentioned, users on my machines do not have root, hence such menu options are of no use and may potentially cause frustration if a user attempts to use them. These menu entries can be removed by setting the gconf keys that specify the command called when these options are selected to a blank string.

$ gconftool-2 --direct  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string --set /desktop/gnome/applications/main-menu/uninstall_package_command ""
$ gconftool-2 --direct  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string --set /desktop/gnome/applications/main-menu/upgrade_package_command ""

The context menus now looks like:

Favourite Applications list

As described in Novell’s documentation, this is done by editing the file /usr/share/gnome-main-menu/applications.xbel as desired.

Documents folder

Now we come to an aspect of the Slab that I find very annoying, the Documents folder. If a user doesn’t have a folder in their home directory called Documents, the Slab menu creates one and puts two template files in there. If the user deletes the Documents folder, the next time they log in it gets recreated. To my mind, this is just needless meddling for no good reason. It is the subject of a bug report that I think was originally raised against openSUSE 10.3 but at time of writing the bug report remains open (https://bugzilla.novell.com/show_bug.cgi?id=327461) and at time of writing the behaviour remains. Fortunately there is a way to get rid of this behaviour. Both of the steps are mentioned separately in the bug report but I’ll repeat them here anyway. The first step is to delete these two files


The second is to edit /usr/share/gnome-main-menu/documents.xbel so that it contains

<?xml version="1.0" encoding="UTF-8"?>
<xbel version="1.0"

Whilst these two steps remove the annoying recreation of the Documents folder, they create two other problems. The first problem is that there is an entry for the Documents folder in the Places menu and if the user doesn’t have a Documents folder, that entry is useless. That’s easily taken care of by editing /usr/share/gnome-main-menu/places.xbel to remove the relevant bookmark entry. The second problem is more aesthetic. With the afore-described modifications in place, the Favourite Documents section is now empty. If the user has no documents in their Favourite Documents list, then the Slab does not display the Documents tab. This result is that the Slab tabs now look like this:

Once the user gets at least one item in their Favourite Documents or Recent Documents list, the Slab displays the Documents tab again and the Slab now looks like this:

As you can see, the Places tab has moved. I found this inconsistency displeasing enough to find a solution, which is to swap the Documents and Places buttons. The layout of the Slab is described by the file /usr/share/gnome-main-menu/slab-window.glade If you open that file in your text editor of choice you’ll find these lines:

   <widget class="GtkRadioButton" id="slab-page-selector-button-documents">

scroll down and you’ll find a </child> tag that corresponds to that <child> tag. Everything between those tags describes the Documents button. Similarly you’ll find these two lines:

   <widget class="GtkRadioButton" id="slab-page-selector-button-places">

and again scroll down and you’ll find a </child> tag that corresponds to that <child> tag. Everything between those tags describes the Places button.

To swap the position of the Places and Documents buttons, take those two chunks of mark up and swap them around. Now when the user has at least one item in their Favourite Documents or Recent Documents list the menu looks like this:

The places button has not moved, but the Documents button has appeared in the previously blank space next to it. If you don’t see the change try restarting the GNOME Panel with

$ killall gnome-panel

Default to Applications Tab

Another aspect of the Slab’s behaviour that I find irritating is that it remembers which tab you were last viewing. If you open the Slab, click on the Places tab, close the Slab and open it again then it’s still on the Places tab. Whilst this has a logic to it, the vast majority of times I open the Slab I want the Applications tab. Worse still, which tab you’re on is remembered between sessions. So you click the Places tab, log out, log back in again later, open the Slab and it’s on the Places tab when you most almost certainly want the Applications tab. I’ve only been able to find a partial solution to this, and that is to default to the Applications tab when the Slab is first opened after login. Which tab has focus is kept track of by a gconf key, so you can set that to a mandatory value that represents the Applications tab.

$ gconftool-2 --direct  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type int /desktop/gnome/applications/main-menu/file-area/file_class 0

Removing clutter from the Control Centre

Moving away from the Slab itself, let’s look at the Control Centre. There’s a whole bunch of icons that appear in the Control Centre which launch programs that require root access. If the users do not have root access, these icons are just useless clutter. Such icons can be hidden from users by removing the group and global read permissions like so:

cd /usr/share/applications/
for i in package-manager.desktop YaST.desktop gnome-power-preferences.desktop alacarte-system.desktop YaST2/users.desktop YaST2/yast-language.desktop YaST2/timezone.desktop YaST2/dsl.desktop YaST2/modem.desktop YaST2/x11.desktop YaST2/lan.desktop YaST2/scanner.desktop gnome-network-preferences.desktop /usr/share/gdm/applications/gdmphotosetup.desktop sax2.desktop nvidia-settings.desktop;do
chmod go-rx $i;

Removing clutter from the Application Browser

Remove KDE apps

My machines have KDE installed as well as GNOME. The default desktop environment to GNOME but KDE is there for people who want to use it. (Why anyone would want to use the half finished version of KDE 4 that’s included in SLED 11 is beyond me, but that’s another topic entirely.)

Having KDE installed means that KDE applications show up in the Application Browser. This is, on the whole, not a good thing. For example, when someone’s looking in the Browse section it’s not helpful for there to an icon for Dolphin with ‘File Manager’ written under it when there’s another icon called Nautilus with ‘File Manager’ written underneath it. It’s potentially confusing and though Dolphin is fine if you’re using KDE, using it in GNOME makes no sense. There are other such cases too numerous to go in to here. So I hide the KDE applications from the Application Browser.

# hides kde apps in gnome menus


function hideapps {
for i in $1/*;do
   if [ -z "$(grep ^$string $i)" ] ;then
      echo "$string" >> $i;

function unhideapp {
   sed -i "s/${string}//" $1

hideapps /opt/kde3/share/applications/kde
hideapps /usr/share/applications/kde4

# KDE apps we want to show up in GNOME menus
unhideapp /opt/kde3/share/applications/kde/kile.desktop

Remove control panel items

Another cause of clutter in the Application Browser is items that also appear in the Control Centre.

For example, consider the following screenshot of the Browse section.

There are three icons there that all look pretty much the same. File Management, Home Folder and Nautilus. Let’s first look at the File Management icon. Its name and presence in the Application Browser could very reasonably lead one to assume that clicking on this will launch a file management application. However what it actually does is open the Nautilus preferences. This is something one would expect to find in the Control Centre. Indeed it does appear there and that in my opinion is the only place it should appear. I find its presence in the Application Browser illogical and unhelpful. Even worse, this icon appears not just once but twice in the Application Browser, once under Browse and again under System. So it has to go. Modifying the relevant .desktop file like so

$ sed -i 's/;FileManager;/;/;s/;System;/;/' /usr/share/applications/nautilus-file-management-properties.desktop

causes the icon not to be displayed in the Application Browser but still be displayed in the Control Centre. Whilst we’re looking at the Browse section, the Home Folder icon is also redundant since clicking it has the exact same result as clicking the Nautilus icon. Also, Home is already listed under the Places tab of the SLAB menu. So that too can go from the Application Browser. Just remove the permissions so it doesn’t get displayed.

$ chmod go-r /usr/share/applications/nautilus-home.desktop

It’s a similar story with the rest of the icons that appear in Control Centre – they show up in the Application Browser despite the fact that they are not applications. This script causes the File Management icon and the rest of the icons that appear in the Control Center to only appear in the Application Browser.

# prevent control centre icons appearing in application browser
for i in $(grep X-SuSE-ControlCenter /usr/share/applications/*.desktop | cut -d : -f 1);do
sed -i 's/;FileManager;/;/;s/;DesktopSettings;/;/;s/;HardwareSettings;/;/;s/;System;/;/;s/;X-SuSE-PrintingUtility;/;/;s/;AdvancedSettings;/;/' $i

The End

Despite all this hacking there are still two aspects of the Slab I dislike that I have yet to work out how to alter. One is the poor translation in to British English. With the GNOME language set to British English some instances of Favourite have a u whilst others do not and Control Centre is still spelt Control Center. The other is the, much discussed in various places, lack of a button to clear the recent documents list.

There is also the small matter of how to keep any of these changes from being reversed by an update. This may become the subject of another article but in brief, the trick is to run a script, or scripts, during boot than ensures the changes are in place combined with only installing updates as part of the machine’s shutdown sequence.

(Visited 1 times, 1 visits today)


  • schwarzg says:

    Very handy and nicely written. Will you give an update on SLE12 which ships with gnome3? Some hints on how to customize the menue of SLE-Classic or Gnome-Classic will be highly welcome.

    • mikewillis says:

      I won’t be doing an equivalent for SLED 12 as due to a change in employment I no longer use SLED.

      I did do work on a deployment of SLED 12. I didn’t find the need to do any hacking on the Application and Places menus that are used in GNOME-Classic and the SUSE exclusive SLE-Classic variant. Unlike the Slab they don’t contain things that I found unhelpful in a managed environment. The menus in GNOME Classic are very simplistic compared to the Slab, they isn’t anywhere near the same scope for modifications.

  • Leave a Reply

    Your email address will not be published.