How to edit and configure CentOS Desktop Menu?

Time:2019-11-13

Related profile:

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

Related contents:

$HOME/.config/menus

/etc/xdg/menus

/usr/share/desktop-directories

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 *

Development.directory:Name=Programming

Development.directory:Name[en_CA]=Programming

Development.directory:Name[en_GB]=Programming

Development-More.directory:Name=More Programming Tools

Development-More.directory:Name[en_GB]=More Programming Tools

Open the development.directory file, starting with the following

[Desktop Entry]

Name=Programming

………………..

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 applications.menu file, but the programs listed under the / usr / share / applications directory are not used

Categories=Education;

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

/etc/xdg/menus

[[email protected] menus]# ll

total 60

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

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

-rw-r–r– 1 root root   488 Jul 6 16:58 gnome-screensavers.menu

-rw-r–r– 1 root root   279 Sep 10 2005 kde-information.menu

-rw-r–r– 1 root root   288 Sep 10 2005 kde-screensavers.menu

-rw-r–r– 1 root root 2198 Aug 10 15:03 kde-settings.menu

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

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 server-settings.menu

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

-rw-r–r– 1 root root   920 Oct 19 23:53 start-here.menu

-rw-r–r– 1 root root 3294 Oct 19 23:53 system-settings.menu

The applications.menu 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

/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

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]

Encoding=UTF-8

//Coding method

Name=aMule

//Application name,

Comment=aMule

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

Exec=amule

//The actual name of the executable application

Icon=amule.png

//Icon displayed in menu item, can be empty

Terminal=false

//Use terminal or not

Type=Application

/ / 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.