Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to edit and configure CentOS desktop menu

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to edit and configure CentOS desktop menus". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Related profile:

* .folders file in / usr/share/applications directory

Related catalogue:

$HOME/.config/menus

/ etc/xdg/menus

/ usr/share/desktop-directories

After modification, the database is generally updated:

Updatedb, update-desktop-database

Update-desktop-database and update-desktop-* series programs are located in the xdg-utils package

-

Qt4-qtconfig is located in System-Administration, and now you want to change it to the Applications-- > Programming menu:

Change (vim / usr/share/applications/qt4-qtconfig.desktop) the

Categories=Qt;Settings; is Categories=Qt;Development

Why not Categories=Qt;Programming;?

Change to the / usr/share/desktop-directories directory:

[root@localhost desktop-directories] # grep Programming *

Development.directory:Name=Programming

Development.directory: name [CA] = Programming

Development.directory: name [GB] = Programming

Development-More.directory:Name=More Programming Tools

Development-More.directory: name [GB] = More Programming Tools

Open the Development.directory file, starting with the following

[Desktop Entry]

Name=Programming

.

It shows that 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 so by adding an entry in the / etc/xdg/menus directory

The entries in the secondary directory are exactly the same as those in the desktop Applications. Items that are empty will not be displayed in Applications; for example, the Education directory menu is written in the applications.menu file, but because the programs listed under the / usr/share/applications directory are not used by the program

Categories=Education

Therefore, in the Applications directory menu, there is no Education subdirectory menu. Try to modify any of the .trees files (qt4- qtconfig.desktop), change Categories to Education, and Applications-- > Education--- > qt4 config will immediately appear in the Applications directory menu

(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

=

[root@localhost menus] # pwd

/ etc/xdg/menus

[root@localhost 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 set whether a menu item is included in the menu item, or even exclude.

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

Answer: the path is set in the PATH environment variable when the program is executed, and the .programs file specifies the application to be executed through the exec in it, and looks for the corresponding application in the path defined by PATH. You can view it as follows:

[root@localhost ~] # 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 the desktop file execute the executable application?

A: you can first take a look at the contents of a simple .resume file:

[root@localhost ~] # cat / usr/share/applications/amule.desktop

[Desktop Entry]

Encoding=UTF-8

/ / Encoding method

Name=aMule

/ / Application name

Comment=aMule

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

Exec=amule

/ / actual name of the executable application

Icon=amule.png

/ / the icon displayed in the menu item can be empty

Terminal=false

/ / whether to use the terminal or not

Type=Application

/ / Classification

Categories=Application;Network; / / Classification

The name of the application is known through the above Exec=amule, and is case-sensitive, and looks for it in the path set by default in the PATH environment variable. It can be executed when found, and an error is reported if it is not found, unless the user has set the special path of the application in PATH.

This is the end of "how to edit and configure CentOS desktop menus". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report