How to edit and configure CentOS Desktop Menu?


Related profile:

/*. Desktop files in the usr / share / applications directory

Related contents:




Generally, the database should be updated after modification:

updatedb, update-desktop-database

The update desktop database and update desktop – * series are both in the XDG utils package


QT4 qtconfig is located in system administration, and now you need to change it to the application – > programming menu:

Change (VIM / usr / share / applications / qt4-qtconfig. Desktop)

Categories = QT; settings; is categories = QT; development;

Why not categories = QT; programming?

Switch to the directory / usr / share / desktop directories:

[[email protected] desktop-directories]# grep Programming *[en_CA]=Programming[en_GB]=Programming Programming Tools[en_GB]=More Programming Tools

Open the file, starting with the following

[Desktop Entry]



Description categories = development corresponds to the programming menu directory in the menu.

Finally, categories = QT; development; can also be written as categories = development;

If you want to add a new menu directory to the applications menu item, you can do this by adding entries in the / etc / XDG / menus directory

The entries in the < Menu > secondary directory are exactly the same as those in desktop applications. If the entry content is empty, it will not be displayed in applications; for example, the education directory menu is written in the file, but the programs listed under the / usr / share / applications directory are not used


Therefore, in the applications directory menu, there is no education subdirectory menu. Try to modify any. Desktop file (QT4 – qtconfig. Desktop), change categories to education, and the applications – > Education – > QT4 config will be displayed in the applications directory menu immediately

(rpm -qi xdg-utils-1.0.2-2.fc8)The following scripts are provided at this time:

* xdg-desktop-menu      Install desktop menu items

* xdg-desktop-icon      Install icons to the desktop

* xdg-icon-resource     Install icon resources

* xdg-mime              Query information about file type handling and

                        install descriptions for new file types

* xdg-open              Open a file or URL in the user’s preferred application

* xdg-email             Send mail using the user’s preferred e-mail composer

* xdg-screensaver       Control the screensaver


[[email protected] menus]# pwd


[[email protected] menus]# ll

total 60

-rw-r–r– 1 root root 12282 Dec 6 16:01

drwxr-xr-x 2 root root 4096 Nov 9 17:16 applications-merged

-rw-r–r– 1 root root   488 Jul 6 16:58

-rw-r–r– 1 root root   279 Sep 10 2005

-rw-r–r– 1 root root   288 Sep 10 2005

-rw-r–r– 1 root root 2198 Aug 10 15:03

-rw-r–r– 1 root root 3020 Oct 19 23:53

drwxr-xr-x 2 root root 4096 Oct 19 23:53 preferences-merged

drwxr-xr-x 2 root root 4096 Nov 9 17:19 preferences-post-merged

-rw-r–r– 1 root root 1241 Oct 19 23:53

-rw-r–r– 1 root root 1127 Oct 19 23:53

-rw-r–r– 1 root root   920 Oct 19 23:53

-rw-r–r– 1 root root 3294 Oct 19 23:53

The file can be used to set whether a menu item is included in a menu item, or even to exclude it

Question). What is the query path of the program executed by the desktop file?

Answer: when executing the program, the path is set in the path environment variable. The. Desktop file specifies the application to execute through exec, and looks up the corresponding application in the path defined by path. You can view it as follows:

[[email protected] ~]# echo $PATH


Question). How does a desktop file execute an executable application?

A: you can first look at a simple. Desktop file:

[[email protected] ~]# cat /usr/share/applications/amule.desktop

[Desktop Entry]


//Coding method


//Application name,


//The name of the prompt when the mouse passes over it


//The actual name of the executable application


//Icon displayed in menu item, can be empty


//Use terminal or not


/ / classification

Categories = application; network; / / categories

The. Desktop file knows the name of the application program through exec = aMule above, and is case sensitive. It is found in the path set by the path environment variable by default. If it is found, it can be executed. If it is not found, an error will be reported, unless the user has set the special path of the application program in the path.