I don’t like how KDE collapses menus of categories containing a single entry, as it does in openSUSE. It doesn’t make things clearer, and application links look pretty silly when represented with a directory icon. I could not find how to change that, neither in KDE settings nor in the freedesktop specs. I finally found a solution, which works halfway, as shown in the image.
- illustrates normal behaviour, as in Ubuntu (and others).
- is openSUSE menus collapsing (feature?).
- is how KDE menus look after I applied the following trick.
The trick consists of creating a dummy desktop file for a faked application (Exec=donothing) represented by a 1x1 transparent icon (Icon=blank.png) and adding it to all categories which contain a single menu entry. However the name could not be left empty, so I used a dot (you can see it in the image).
# cat /usr/local/share/applications/X_dummy.desktop [Desktop Entry] Name=. Comment=Dummy menu entry Exec=donothing Icon=blank.png Terminal=false Type=Application StartupNotify=true OnlyShowIn=KDE Categories=X-Administration-Gnome-Personal;X-Administration-Gnome-System-gdm;X-Administration-Kde-Desktop;X-Communication-Chat-Gnome;X-Applications-Programming-Python;X-Applications-DTP; # comment out the following line to collapse menus (openSUSE default) #Hidden=true
I know, it’s a quick and dirty hack. It would be better to simply disable menus collapsing but I couldn’t figure out how. The desired behaviour is the one shown in picture 1.