Xfce Wiki

Sub domains
 

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dk:howto:customize-menu [2009/12/05 17:33] 77.254.221.69dk:howto:customize-menu [2017/03/18 18:30] (current) – removed skunnyk
Line 1: Line 1:
-====== Tilpas menuen i Xfce ====== 
-Denne side beskriver hvordan du tilpasser menuen ved brug af xfcesktop **4.5 eller højere** og libxfce4menu til dit skrivebord. Bemærk, 
-at der ikke findes en grafisk menuredigering til 4.6. Vi håber den vil komme tilbage i 4.8. 
  
-===== Hvad installerer xfdesktop ===== 
-Xfdesktop installerer en menufil samt skrivebordsposter til menuen root (Kør, Terminal, Filhåndtering, …). For 
-at tilpasse din menu skal du ændre disse. 
- 
-===== Redigér menufilen ===== 
-Opret mappe ~/.config/menus (hvis denne ikke findes allerede): 
-  mkdir ${XDG_CONFIG_HOME:-~/.config}/menus/ 
-Kopiér den installerede til din hjemmemappe: 
-  cp $prefix/etc/xdg/menus/xfce-applications.menu ${XDG_CONFIG_HOME:-~/.config}/menus 
- 
-===== Skjul root-poster ===== 
-Hvis du vil fjerne menuelementer fra root-menuen, skal du kopiere de specifikke skrivebordspostfiler til din hjemmemappe, 
-og derefter tilføj/ændr nøgleposten NoDisplay i disse. Mere information omkring de anvendte skrivebordspostfiler kan findes [[http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html|her]]. 
- 
-xfdesktop installerer de følgende skrivebordspostfiler: 
- 
-  * ''$prefix/share/applications/xfce4-about-xfce.desktop'' 
-  * ''$prefix/share/applications/xfce4-file-manager.desktop'' 
-  * ''$prefix/share/applications/xfce4-help.desktop'' 
-  * ''$prefix/share/applications/xfce4-logout.desktop'' 
-  * ''$prefix/share/applications/xfce4-run-program.desktop'' 
-  * ''$prefix/share/applications/xfce4-terminal.desktop'' 
-  * ''$prefix/share/applications/xfce4-web-browser.desktop'' 
- 
-For at skjule en specifik skrivebordspostfil kopierer du det til din hjemmemappe, som eks.: 
- 
-  cp $prefix/share/applications/xfce4-web-browser.desktop ~/.local/share/applications 
- 
-og derefter ændre eller tilføj skrivebordspostnøglen NoDisplay: 
- 
-  NoDisplay=true 
- 
- 
-=== Fosel mellem NoDisplay og Hidden === 
-{{wiki:warning.png |}} Hvis du har gennemset specifikationerne til skrivebordspostfilen, har du måske allerede bemærket forskellen mellem disse to postnøgler.  NoDisplay vil skjule programmet fra menuen men MIME-tilknytningen vil stadig blive læst af Thunar (som eksempel).  Indstilling af postnøglen Hidden til true fungerer som sletning af filen. 
- 
- 
-===== Opret root-poster ===== 
-Dine egne menuelementer findes i ''~/.local/share/applications''. 
- 
-I denne kan du oprette skrivebordsfilposter som standard pr menuelement. som eksempel for et menuelement til opstart af Eclipse, oprette en fil navngivet ''eclipse.desktop'' i ''~/.local/share/applications'': 
- 
-  [Desktop Entry] 
-  Version=1.0 
-  Type=Application 
-  Encoding=UTF-8 
-  Exec=eclipse 
-  Icon=eclipse 
-  StartupNotify=false 
-  Categories=X-XFCE;X-Xfce-Toplevel; 
-  OnlyShowIn=XFCE; 
-  Name=Eclipse 
-  Comment=Eclipse Java IDE 
- 
-For at denne vil fremkomme, skal du ændre ''${XDG_CONFIG_HOME:-~/.config}/menus/xfce-applications.menu'', som eksempel: 
- 
-<code xml> 
-  <Menu> 
-    <Name>Xfce</Name> 
- 
-    <DefaultAppDirs/> 
-    <DefaultDirectoryDirs/> 
- 
-    <Include> 
-        <Category>X-Xfce-Toplevel</Category> 
-    </Include> 
- 
-    <Layout> 
-        <Filename>xfce4-terminal.desktop</Filename> 
-        <Separator/> 
-        <Filename>eclipse.desktop</Filename> 
-     
-    [...] 
-</code> 
- 
- 
-===== Redigér poster ===== 
- 
-Begyndende fra version 4.5 understøtter libxfce4menu ikke "Merge" fra menuspecifikationen. Dette betyder, at det ikke er muligt at bygge en pæn menuredigering. For at tilføje/fjerne eller redigere menuposter er du nødt til at kopierer filerne manuelt. 
- 
-Lad os sige at "gvim" er installeret og du bør have skrivebordspostfilen ''/usr/share/applications/gvim.desktop'' Kopiér denne fil til din hjemmemappe ''~/.local/share/applications'' Derefter kan du ændre denne. 
- 
-For at oprette en ny menupost, kan du oprette en ny skrivebordspostfil i det tidligere nævnte mappe ''exo-desktop-item-edit'' letter oprettelse af en sådan fil.  For eksempel kør ''%%exo-desktop-item-edit --create-new ~/.local/share/applications/%%''. 
- 
-===== Create submenus ===== 
-To create a new submenu, add a new "Menu" element to your ~/.config/menus/xfce-applications.menu at the same level as the other XFCE submenus like "Graphics" or "Multimedia". In addition to the aptly named "Name" element, two additional elements are required: first, the "Directory" element is useful to associate the submenu with a desktop entry file which provides, among others, an appropriate icon as we will see shortly. Second, the "Category" element associates .desktop files with this submenu. It is recommended to make up a custom category starting with "X-", which is the prefix of non-standard categories by convention. As an example, we'll create a submenu with entries to display various folders in your favourite file manager. Your new entry should look like this: 
- 
-<code xml> 
-  <Menu> 
-    <Name>Folders</Name> 
-    <Directory>folders.directory</Directory> 
-    <Include> 
-      <Category>X-Folders</Category> 
-    </Include> 
-  </Menu> 
-</code> 
- 
-Next, create ~/.local/share/desktop-directories/folders.directory with the following contents: 
- 
-  [Desktop Entry] 
-  Version=1.0 
-  Type=Directory 
-  Icon=file-manager 
-  Name=Folders 
-  Comment=Folders viewed in a file manager 
- 
-This provides the displayed name of the subdirectory as well as an appropriate icon. 
- 
-Finally, create .desktop files in your ~/.local/share/applications folder as shown above to populate the submenu. In order to be displayed in the submenu, add your custom category to the "Categories" list. One of these files, let's call it thunar-home.desktop, might look like this: 
- 
-  [Desktop Entry] 
-  Version=1.0 
-  Type=Application 
-  Exec=/usr/local/bin/thunar /usr/home/yourname 
-  Icon=file-manager 
-  StartupNotify=false 
-  Categories=X-Folders; 
-  OnlyShowIn=XFCE 
-  Name=home 
-  Comment=home displayed in Thunar 
- 
-With all this in place, and after refreshing the menu if needed (see below), you should have a new submenu called "Folders" using the file manager icon. Daisen 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. 
- 
-===== Reload the menu ===== 
- 
-If you don't have file monitoring support, run ''%%xfdesktop --reload%%'' to refresh the menu. 
- 
-If the above does not work, you might also try to run ''%%killall -HUP xfdesktop%%'' instead. 
- 
-Enjoy! 
- 
-===== What, if it does not work? ===== 
-questions unanswered:  
- 
-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/) 
- 
-where do i find a log or anything like that, actually giving me a clue other than simply empty space in the menu? 
- 
-A XFCE Lover that's got very upset. I setup several machines for my company. After migrating all the software to the new version 9.04 we realized we cannot use the custom menus that points to our software with specific variables. 
- 
-Answer: In Jaunty the appropriate file might be found in /etc/xdg/xubuntu/menus/xfce-applications.menu and not in /etc/xdg/menus/xfce-applications.menu. Everything else should work as described above. Could be any other *buntu-flavor in the path also, I have no appropriate machine to compare. 
-Also note, that you should not only extend your Layout-Section but also your Include-Section ...