Diferencia entre revisiones de «Vitalinux/menus gnome2»

De WikiEducator
Saltar a: navegación, buscar
(Configuración de los menús en Gnome2)
m
Línea 15: Línea 15:
 
* There are .directory files that correspond to the Sections in your Menu (Accessories, Games, Graphics, etc.) *These files are located in /usr/share/desktop-directories. You will need write permissions to this directory.
 
* There are .directory files that correspond to the Sections in your Menu (Accessories, Games, Graphics, etc.) *These files are located in /usr/share/desktop-directories. You will need write permissions to this directory.
  
{{NOta|This HOWTO shows you how to edit the standard menu for all users on your system - if you would like to change only your own menu, the directories you will be using are: ~/.config/menus, ~/.local/share/applications, and ~/.local/share/desktop-directories, respectively. These local versions of the menuing system can be trickier to work, simply because the local menu merges with the standard menu - possibly causing duplicate entries, etc.}}
+
{{Nota|This HOWTO shows you how to edit the standard menu for all users on your system - if you would like to change only your own menu, the directories you will be using are: ~/.config/menus, ~/.local/share/applications, and ~/.local/share/desktop-directories, respectively. These local versions of the menuing system can be trickier to work, simply because the local menu merges with the standard menu - possibly causing duplicate entries, etc.}}
  
 
In order to actually create the submenus, you will be editing an XML file on your system, as well as creating a special file called a ".directory" file.'''In preparation for editing your menu, please have the following applications open:gedit''' - with the file /etc/xdg/menus/applications.menu open for editing, plus a new blank document open. ''Note: you will need an icon to use for your submenus - you can reuse the same icon/file, or you can create a new .directory file with a different icon for every submenu you wish to create. Here is the icon I use: ''[[Image:more-menu.png]]'''nautilus''' - open to the directory /usr/share/applications'''nautilus '''- open to the directory /usr/share/desktop-directories'''To create the Submenu .directory file (which you will need first):'''1. In the blank document - type the following code:
 
In order to actually create the submenus, you will be editing an XML file on your system, as well as creating a special file called a ".directory" file.'''In preparation for editing your menu, please have the following applications open:gedit''' - with the file /etc/xdg/menus/applications.menu open for editing, plus a new blank document open. ''Note: you will need an icon to use for your submenus - you can reuse the same icon/file, or you can create a new .directory file with a different icon for every submenu you wish to create. Here is the icon I use: ''[[Image:more-menu.png]]'''nautilus''' - open to the directory /usr/share/applications'''nautilus '''- open to the directory /usr/share/desktop-directories'''To create the Submenu .directory file (which you will need first):'''1. In the blank document - type the following code:

Revisión de 06:52 20 nov 2014

Configuración de los menús en Gnome2

Road Works.svg Trabajo en proceso, espera cambios frecuentes. Tu ayuda y retroalimentación son bienvenidos.
Ver página de charlas.
Road Works.svg


http://ubuntuforums.org/showthread.php?t=36479

HOWTO: Create & populate Sub-Menus in the Applications Menu


(Comment.gif: This HOWTO assumes general Gnome familiarity along with experience using the command line and changing permissions.)



In Gnome, the Menuing system works like this:

  • There is an XML file (applications.menu) that sets up the structure of the Menu. *This is located in /etc/xdg/menus. You will need write permissions to this file.
  • There are .desktop files that correspond to the icons / launchers in your Menu. *These files are contained in possibly multiple directories on your system, including: "/usr/share/applications," "/usr/share/gnome/apps," and "/etc/X11/applnk." In order to better control your Menu, you will need to have all of your .desktop files in /usr/share/applications.
  • There are .directory files that correspond to the Sections in your Menu (Accessories, Games, Graphics, etc.) *These files are located in /usr/share/desktop-directories. You will need write permissions to this directory.


(Comment.gif: This HOWTO shows you how to edit the standard menu for all users on your system - if you would like to change only your own menu, the directories you will be using are: ~/.config/menus, ~/.local/share/applications, and ~/.local/share/desktop-directories, respectively. These local versions of the menuing system can be trickier to work, simply because the local menu merges with the standard menu - possibly causing duplicate entries, etc.)



In order to actually create the submenus, you will be editing an XML file on your system, as well as creating a special file called a ".directory" file.In preparation for editing your menu, please have the following applications open:gedit - with the file /etc/xdg/menus/applications.menu open for editing, plus a new blank document open. Note: you will need an icon to use for your submenus - you can reuse the same icon/file, or you can create a new .directory file with a different icon for every submenu you wish to create. Here is the icon I use: Archivo:More-menu.pngnautilus - open to the directory /usr/share/applicationsnautilus - open to the directory /usr/share/desktop-directoriesTo create the Submenu .directory file (which you will need first):1. In the blank document - type the following code:

Idioma no válido.

Necesita especificar un idioma como esto: <source lang="html4strict">...</source>

lenguajes soportados para sintaxis remarcada:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


[Desktop Entry]

Name=More

Comment=More Applications

Icon=more-menu

Type=Directory

Save the file as "more.directory" into /usr/share/desktop-directories.Close the file. (The Icon=more-menu is how you would change the icon for the directory, you can put in an absolute path, such as /usr/share/pixmaps/my-special-icon.png or you can use the shorthand notation which I use here, if your icon is in either your theme or the pixmaps directory on your system. "more-menu.png" is in both my theme and my pixmaps directory.)2. In the nautilus window that is open to the directory /usr/share/desktop-directories, you should see your icon labelled "More."As an example of how to create & populate submenus, we will be working with the "System Tools" section of the Applications Menu:In the applications.menu file, scroll down to the section that begins, In order to have a populated submenu without duplicate icons appearing, we need to specify that our launcher/icon not be shown in the main section of the System Tools menu, and also be shown in the submenu. Let's start with creating the submenu to be populated. 1. Create a blank line under the </Include> and before </Menu> of the System Tools section of the applications.menu file.2. Add in the following code to that blank line: 


        <Menu>
          <Name>More</Name>
          <Directory>more.directory</Directory>
          <Include>
          </Include>
        </Menu>

This code creates the submenu structure.Now that we have the submenu created, we need to populate it. In this example, we will first populate the submenu with the "Floppy Formatter" launcher/icon, and then remove the "Floppy Formatter" launcher/icon from the main System Tools section.1. In your nautilus window open to /usr/share/applications, locate the icon named "Floppy Formatter."2. Drag this icon to the toolbar of gedit.3. gedit will open the .desktop file and show you what it's exact name is - in my case, it's "gfloppy.desktop" ... you need to know this name in order to move this launcher/icon around in your menu file.4. Close the "gfloppy.desktop" tab.5. In the applications.menu file, scroll down to the new code you just entered that created the "More" area.6. Between the <Include></Include>, enter the following code:


<Filename>gfloppy.desktop</Filename>

7. Move up to the area right above the "More" - to where it says <Category>System</Category>

8. Add a blank line after <Category>System</Category>

9. Enter the following code:

 <Not>
 <Filename>gfloppy.desktop</Filename>
 </Not>

10. Save the applications.menu file. In order to see your changes, you may need to do a "killall gnome-panel."In your Applications menu, down at System Tools - if you hover your mouse over the section name, you should see a new icon at the top, "More" - with an arrow which if you follow, you should see a second menu with the Floppy Formatter launcher/icon inside.The key point is that you had to tell the menu

<Not><Filename>gfloppy.desktop</Filename></Not> 

for the regular section, at the same time telling it <Filename>gfloppy.desktop</Filename> in the new "More" menu. Using these processes, it is now possible for you to create many submenus, and move around your launchers/icons. (At least until the next version of gnome...) (Comment.gif: if you move a launcher/icon in this manner, and find that there are duplicates in your menu, this can be caused by either .desktop files in other directories, or your local copy of applications.menu has the .desktop file specified. You may need to remove duplicate .desktop files and / or your local)


applications.menu. Happy Menuing!