Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:customize-menu [2013/12/03 20:30]
ammo [Unanswered] Some answers. Needs work, but it's a start.
howto:customize-menu [2019/12/09 07:10] (current)
kevinbowen
Line 3: Line 3:
 This page describes how to customize the menu, using Xfdesktop **4.5 or higher**. ​ For earlier versions you can use the libxfce4menu GUI. This page describes how to customize the menu, using Xfdesktop **4.5 or higher**. ​ For earlier versions you can use the libxfce4menu GUI.
  
-A GNU-licensed graphical menu editor for LXDE, [[http://​lxmed.sourceforge.net|LXMenuEditor]],​ also works for XFCE, as of XFCE 4.8.0 and LXMenuEditor 20110523.+A GNU-licensed graphical menu editor for LXDE, [[http://​lxmed.sourceforge.net|LXMenuEditor]],​ also works for Xfce, as of Xfce 4.8.0 and LXMenuEditor 20110523. ​[[https://​launchpad.net/​menulibre|MenuLibre]] is another freedesktop.org standard-compliant editor that works well with Xfce. 
 + 
 +----
  
 ===== What xfdesktop installs ===== ===== What xfdesktop installs =====
 Xfdesktop installs a menu file and .desktop files which together with non-xfdesktop .desktop files define the menu. To customize your menu you need to modify them.  The method described here modifies the menu file identified by the $XDG_CONFIG_HOME variable (usually null, so ~/​.config/​menus/​xfce-applications.menu) and copies of .desktop files in your home directory. Xfdesktop installs a menu file and .desktop files which together with non-xfdesktop .desktop files define the menu. To customize your menu you need to modify them.  The method described here modifies the menu file identified by the $XDG_CONFIG_HOME variable (usually null, so ~/​.config/​menus/​xfce-applications.menu) and copies of .desktop files in your home directory.
 +
 +----
  
 ===== When xfdesktop implements your changes ==== ===== When xfdesktop implements your changes ====
 If the menu file's directory exists when the xfdesktop session starts, changes to the menu file are implemented immediately. ​ Similarly if the //​.local/​share/​applications//​ directory in your home directory exists when the xfdesktop session starts, changes to its .desktop files are implemented immediately. If the menu file's directory exists when the xfdesktop session starts, changes to the menu file are implemented immediately. ​ Similarly if the //​.local/​share/​applications//​ directory in your home directory exists when the xfdesktop session starts, changes to its .desktop files are implemented immediately.
 +
 +----
  
 ===== Copy the menu file ===== ===== Copy the menu file =====
Line 20: Line 26:
 or or
   cp $prefix/​etc/​xfce/​xdg/​menus/​xfce-applications.menu ${XDG_CONFIG_HOME:​-~/​.config}/​menus   cp $prefix/​etc/​xfce/​xdg/​menus/​xfce-applications.menu ${XDG_CONFIG_HOME:​-~/​.config}/​menus
 +
 +[[|Back to Top]]
 +----
  
 ===== Copy a .desktop file ===== ===== Copy a .desktop file =====
Line 26: Line 35:
 or or
   cp /​usr/​share/​applications/​xfce4-web-browser.desktop ~/​.local/​share/​applications   cp /​usr/​share/​applications/​xfce4-web-browser.desktop ~/​.local/​share/​applications
 +
 +----
 +
 ===== Hide menu entries ===== ===== Hide menu entries =====
 If you want to hide menu entries from all menus, copy their .desktop files and edit them to add a ''​NoDisplay=true''​ line. If you want to hide menu entries from all menus, copy their .desktop files and edit them to add a ''​NoDisplay=true''​ line.
  
->> {{wiki:​warning.png}} +<note tip>As explained[[http://​standards.freedesktop.org/​desktop-entry-spec/​latest/​ar01s05.html| here]], ''​NoDisplay=true''​ will hide the application from the menu but the mime type associations will still be available. ''​Hidden=true''​ is equivalent to deleting the file.</​note>​
->> As explained[[http://​standards.freedesktop.org/​desktop-entry-spec/​latest/​ar01s05.html|here]],​ ''​NoDisplay=true''​ will hide the application from the menu but the mime type associations will still be available. ''​Hidden=true''​ is equivalent to deleting the file. +
 ===== Hide only root entries ===== ===== Hide only root entries =====
 If you only want to remove menu items from the root menu only, copy their .desktop files and edit them to remove Category X-Xfce-Toplevel. If you only want to remove menu items from the root menu only, copy their .desktop files and edit them to remove Category X-Xfce-Toplevel.
Line 46: Line 56:
  
 For example, to remove Web Browser from the root menu, copy its .desktop file and edit it, changing ''​Categories=X-XFCE;​X-Xfce-Toplevel;''​ to ''​Categories=X-XFCE;''​ For example, to remove Web Browser from the root menu, copy its .desktop file and edit it, changing ''​Categories=X-XFCE;​X-Xfce-Toplevel;''​ to ''​Categories=X-XFCE;''​
 +
 +[[|Back to Top]]
 +----
  
 ===== Add entries ===== ===== Add entries =====
Line 80: Line 93:
 </​code>​ </​code>​
 Any .desktop files with categories including Accessibility,​ Core, Legacy or Utility will be shown in the Accessories sub-menu providing they do not also have ''​NoDisplay=true''​. Any .desktop files with categories including Accessibility,​ Core, Legacy or Utility will be shown in the Accessories sub-menu providing they do not also have ''​NoDisplay=true''​.
 +
 +----
  
 ===== The Other sub-menu ===== ===== The Other sub-menu =====
Line 85: Line 100:
  
 If you have an Other sub-menu and do not want it, copy the .desktop file and modify its categories so it is included in one of the other sub-menus. If you have an Other sub-menu and do not want it, copy the .desktop file and modify its categories so it is included in one of the other sub-menus.
 +
 +[[|Back to Top]]
 +----
  
 ===== Create sub-menus ===== ===== Create sub-menus =====
Line 124: Line 142:
  
 With all this in place, you should have a new submenu called "​Folders"​ using the file manager icon. The submenu entry shown above should display your home directory in Thunar. You can of course add more entries as shortcuts to common places like /cdrom, /stick, /, or whatever you see fit. With all this in place, you should have a new submenu called "​Folders"​ using the file manager icon. The submenu entry shown above should display your home directory in Thunar. You can of course add more entries as shortcuts to common places like /cdrom, /stick, /, or whatever you see fit.
 +
 +----
  
 ===== Forcing changes ===== ===== Forcing changes =====
Line 132: Line 152:
 If that doesn'​t work, try If that doesn'​t work, try
   killall -HUP xfdesktop   killall -HUP xfdesktop
 +
 +[[|Back to Top]]
 +----
  
 ===== Questions ===== ===== Questions =====
Line 144: Line 167:
 **Question:​** I want to add an entry for an application that's installed by hand, rather than through the package manager. If I make a local copy of /​etc/​xdg/​xubuntu/​menus/​xfce-applications.menu,​ then when I add a further application using the package manager, won't it change only the master? Will I have to re-copy and re-edit? **Question:​** I want to add an entry for an application that's installed by hand, rather than through the package manager. If I make a local copy of /​etc/​xdg/​xubuntu/​menus/​xfce-applications.menu,​ then when I add a further application using the package manager, won't it change only the master? Will I have to re-copy and re-edit?
 **Answer:** No. The menu file defines which categories of entry go where. Your further application will appear in the defined place(s). If not, compare its categories with the categories in the menu file and adjust accordingly. ​ Another possible gotcha is that the .desktop file has an OnlyShowIn or NotShowIn line that does not match Xfce. **Answer:** No. The menu file defines which categories of entry go where. Your further application will appear in the defined place(s). If not, compare its categories with the categories in the menu file and adjust accordingly. ​ Another possible gotcha is that the .desktop file has an OnlyShowIn or NotShowIn line that does not match Xfce.
 +
 +[[|Back to Top]]
 +----
  
 ==== Unanswered ==== ==== Unanswered ====
  
   * With which command can I set a start-up-password for an application in the *.desktop file?   * With which command can I set a start-up-password for an application in the *.desktop file?
-My approach would be to remove execution rights for others (chmod o-x filename) and start the command using '​gksudo filename'​ included in package gksu (apt-get install gksu). You may need to provide some command line options before the filename to tune the behaviour of gksu. In this way users have to be members of group sudo to start the program, and enter their own password to confirm their identity. You could also make the program owned by a special group, e.g. powerusers (sudo addgroup powerusers),​ that have execution rights (e.g. chown root:​powerusers filename && chmod g+x filename && chmod o-x filename) and then users would have to be a member of group powerusers (adduser someuser powerusers) to start the command ​with their own password ​after logging in and out of the system to apply the new group membership.+ ​One ​approach would be to remove execution rights for others (chmod o-x filename) and start the command using 'Exec=gksudo filename' ​(gksudo is included in package gksu apt-get install gksu). You may need to provide some command line options before the filename to tune the behaviour of gksu. In this way users have to be members of group sudo to start the program, and enter their own password to confirm their identity. You could also make the program owned by a special group, e.g. powerusers (sudo addgroup powerusers),​ that have execution rights (e.g. chown root:​powerusers filename && chmod g+x filename && chmod o-x filename) and then users would have to be a member of group powerusers (adduser someuser powerusers) to start the command after one-time ​logging in and out of the system to apply the new group membership ​to their user profile. Users that are not members of that group will simply not be able to run the program at all.  
 + If you really want a password prompt, you can also run the program using '​Exec=gksu --user someuser filename'​ in the .desktop file in order to require someuser'​s password before running the program. However, running programs as a different user is not generally recommended for more complex programs unless you know how to avoid the side-effects (e.g. different home directory, security policy, etc.).
  
   * What do i do, if the above does //not// work? (only xfce's own desktop files are seen, not even the one created with exo-desktop-item-edit,​ not to speak from common desktop files in both /​usr/​share/​applications/​ and ~/​.local/​share/​applications/​)   * What do i do, if the above does //not// work? (only xfce's own desktop files are seen, not even the one created with exo-desktop-item-edit,​ not to speak from common desktop files in both /​usr/​share/​applications/​ and ~/​.local/​share/​applications/​)
Line 154: Line 181:
  
   * Where do i find a log or anything like that, actually giving me a clue other than simply empty space in the menu?   * Where do i find a log or anything like that, actually giving me a clue other than simply empty space in the menu?
 +View /​usr/​share/​applications,​ ~/​.local/​share/​applications,​ etc. with Thunar. You should see a plain .desktop file listed for the blank entry, between the clickable icons with fancy names.
   * I run Jaunty and need to make the menu to be multi-level,​ which, in previous versions I believe, could be achieved by editing '///​etc/​X11/​xdg/​xfce4/​desktop/​menu.xml//'​ and replace //​style="​simple"//​ with //​style="​multilevel"//​ in the //<​include>//​. How do I do this in Jaunty? I need this because I have certain applications under Wine which have very many start-menu entries and they are all merged into one menulevel, which is really annoying to navigate thru. Please help ...   * I run Jaunty and need to make the menu to be multi-level,​ which, in previous versions I believe, could be achieved by editing '///​etc/​X11/​xdg/​xfce4/​desktop/​menu.xml//'​ and replace //​style="​simple"//​ with //​style="​multilevel"//​ in the //<​include>//​. How do I do this in Jaunty? I need this because I have certain applications under Wine which have very many start-menu entries and they are all merged into one menulevel, which is really annoying to navigate thru. Please help ...
-See the part above about creating Categories.+See http://​forums.opensuse.org/​english/​get-technical-help-here/​applications/​477258-flat-menu-xfce.html 
 + 
 +[[|Back to Top]] 
 +---- 
 +[[https://​docs.xfce.org/​xfce/​xfce4-panel/​start|Back to xfce4-panel main page]]