Pages

2013-03-16

Xfce manual menu editing

(Things described here are Xubuntu-based)
As was said some tens of times: first - copy your bloody menu  files!
/usr/share/applications --> ~/.local/share/applications
/etc/xdg/menus --> ~/.config/menus

In principle, manual menu editing is a piece of cake, or also might be said - simple as shit... But - IT TAKES TIME. What you can do in 5-10 minutes in editor, takes 1 to 1,5 hours manually.

How to: ~/.local/share/applications is a folder with all .desktop files, those files get dragged into your Menu, automagically.
Example (of only .desktop file I made in current installation):
[Desktop Entry]
Version=1.0
Name=SpaceFM Settings
GenericName=File Manager
Exec=spacefm --show-pref=1
Icon=spacefm
StartupNotify=true
Type=Application
Terminal=false
Categories=GTK;Settings;DesktopSettings;
X-XFCE-SettingsDialog;X-XFCE-PersonalSettings;

This one is settings-window of spacefm which goes to Settings Manager. And important items here are:
-- exec runs the app, (with or without additional parameters, depending on case).
-- Icons can be changed from right-click on launcher, pick 'Properties', click icon and pick the favourite. Or - the right icon can be searched out and added here manually, of course.
-- Categories: Items are sorted by categories. Very importnant! I am not going to write exhaustively how to... You have to experiment. For example, 'Top level' means that the item is in first, open menu, Graphics goes to Graphics ... and so on - have a fun.
Basically, things can be re-oriented to different categories. Shitty thing is, occasionally they are defined quite cryptically - it's hard to understand what the hell it means... that's why we have to experiment.
Two important additional commands to write into .desktops:
-- NoDisplay=true - hides item, but it still will be available to mime-types;
-- Hidden=true - this is like a delete.
Now, when doing your shit - changes should be seen at once. If not, do
xfdesktop --reload
or login/logout if writing command line seems overstreched effort.

One, err - should we say - most entertaining parts is 'Settings' menu, which displays items in two places: in Settings Menu category and also in Settings Manager. Adding 'hidden' into .desktops hides things in Manager too - so, different methodology is required. Modifying xfce-applications.menu file is needed here.
To remove item from Settings Menu, but retain it in Settings Manager. Open aforementioned file, and quite at the beginning of file, ADD something like that into your file:
 <Include>
            <Category>Settings</Category>
        </Include>
# added part goes next, here:

    <Exclude>
    <Filename>xfce4-accessibility-settings.desktop</Filename>
#and here goes the next one, and next...
    </Exclude>

If you want something to <include> into Menu, do it... but remember - if it's item outside of thematic folders, 'Top Level'-category has to be added.

Whole thing is a balancing act between those two - desktop-files and menu-file. And DO NOT forget to look into Xfce wiki.

No comments: