Re: Adding item to the menu (GNOME)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On  Wed, 10 Mar 2004 21:21:33 +0200
> whichever you want. their names matches treir contents quite well (at
> least i haven't had any problems of determining which desktop entry is
> which menu item)
>
> open them with vim (or whatever text editor your'e using), take a closer
> look :) Those who start with kde probably are kde games.
>
> If you want to remove the menu item (but not the coresponding app) just
> delete that desktop file. If you are not sure, check the Name tag (???)
> inside the file - it contains the name you see in Applications menu and
> Nautilus
>
> If you want to add a menu item, create new file with .desktop extension
> (haven't tried without, maybe it works too). All application menu
> entries have Categories=Application; games have category 'Game;' Sound &
> Video have 'AudioVideo'; (those are the ones i have changed the most -
> some games like enemy territory have 'Games;' instead of 'Game;', that's
> how i found out that i can edit menu without risking to lose it)
>
> If you want to add new submenu i'm afraid i can't help you at the moment
> - the menu itself is a xml-style file (i think it was called gnome vfs)
> i know it exists somewhere but i can't remember where it is and how i
> found it :) (because i didn't need it at the moment i had found it so i
> closed the file)
>
> pinco wrote:
> > thedogfarted ha scritto:
> >> try this:
> >>
> >> cd /usr/share/applications
> >> ls
> >>
> >> and what do you see now??
> >>
> >> if i open /usr/share/applications i can't see any .desktop files too,
> >> that's because nautilus displays the names specified in those files.
> >
> > Hi, I see a lot of gnome-xxxxx-xxx.desktop and kde-xxxx-xxx.desktop!
> >
> > Which one should I modify?
> >
> > Ciao,
> > Nino

Hey,

I 've recorded my mini-howto in managing panel menus/submenus manually:

 How-To Add a Submenu To The Default Folder Structure
   ====================================================
   
   This sample assume that we want to add two sub-menus 'StarOffice 7' and
   'Docu & Admin' to the 'Office' menu in the default Main Menu on the panel.
   These enhancements should be for a local user only.
   
   The OpSystem is Fedora Cora 1, custom installation with all pkg's.

   Tree of the 'Main Menu' in the default Panel  with nodes / submenu's
   only (no launcher-obj):

   Tree: Application         # root/main menu-icon on the panel
   snip:  
 |   .....          # tip-text = Main Menu
 |-- Internet
 |    
 |-- Office                            # 1st submenu
 |    |__ More Office Applications     # sub-submenu
 |    |
 |    |__ StarOffice 7               < < NEW sub-submenu
 |        ^^^^^^^|^^^^
 |               |__ Docu & Admin    < < NEW sub-sub-submenu
 |-- Other           ^^^^^^^^^^^^
 |   ......
          
          
   (1) Edit File "applications.menu"
       ----------------------------
       Add the new sub-folder/sub-menu to the applications.menu file i.e.
       the the definition file of the whole Menu Structure:
   
       ° make a backup copy of the file to edit.
       
       ° as ROOT edit file '/etc/X11/desktop-menus/applications.menu'
       
         - if deciding a local enhancement only, you must set the path
           to the *.desktop files at the begining of this menu file add:
           
              <!-- Local for User=xyz  -->
              <MergeDir>/home/ksa/.gnome/apps/StarOffice-7</MergeDir>
       
         - carefully search the folder 'Office'; 
           Note: the folder's <Name> is a script-variable and may be something
                 different.
           <Folder>                         # begin folder 'Office'
 |     <Name>myOffice</Name>
 -     . . .
 |     <Query>
 -        .....
 |     </Query>
 -                                  # folder 'More Office ...
 |     <Folder>
 v     |    <Name>MoreMyOffice</Name
 |    +       ...
 -     |    <DontShowIfEmpty/>
 |     </Folder>
 -
 |     ^^^^    -     <Folder> - begin 'StarOffice 7'
 -     ^^^^    |         <Name>StarOffice7</Name>
 |                        <Desktop>StarOffice7.directory</Desktop>
 -              |          <Query>
 |                              <Keyword>Application</Keyword>
 -              |               <Keyword>sOffice-7</Keyword>
 |                       </Query>
 -  >  insert here:    < -  <Folder>  
 |                              |      <Name>DocAdmin</Name>
 -              |               *     <Desktop>StarOffice7-DocuAdmin</Desktop>
 |                              |      <Query>
 -              |               *          <Keyword>sOffice7-Doc</Keyword>
 |                              |      </Query>
 -              |               *     <DontShowIfEmpty/>
 |                              -  </Folder>
 -              |         <DontShowIfEmpty/>
 |      vvvv   -     </Folder> - end   'StarOffice 7' 
 -      vvvv
 |     <DontShowIfEmpty/>
 </Folder>                        # end folder 'Office' 


e.g. for 'Docu & Admin' folder we define:
           
<Folder>               # begin 'StarOffice 7'
     . . . . . 
     <!-- More StarOffice 7  -->            # comment
     <Folder>                               # start submenu item
     <Name>DocAdmin</Name>              # folder script variable
     <Desktop>StarOffice7-DocuAdmin</Desktop> # *.directory file
     <Query>   ^^^^^^^^^^^^^^^^^^^^                          
          <Keyword>sOffice7-Doc</Keyword> # Categories in *.desktop
     </Query>         ^^^^^^^^^^^^
     <DontShowIfEmpty/>
     </Folder>                              # end submenu
             
     <DontShowIfEmpty/>
</Folder>              # end 'StarOffice 7'

       ° save file
       


   (2) Edit The *.directory Files
       ----------------------------
       Edit for every sub-menu a file [name].directory, where [name] is
       the defined name in tag <Desktop>StarOffice7-DocuAdmin</Desktop> of
       the previous changed 'applications.menu' file.
       For locally use save it to a user dir and create a symLink in the pre-
       defined global subdirectory '/usr/share/desktop-menu-files/'.
       
       ° as <USER> create local directory e.g.
            $ mkdir ~/.gnome/apps/menu-files
            $ cd    ~/.gnome/apps/menu-files
       ° create a NEW file [name].directory:
            $ [edit] ./StarOffice7-DocuAdmin.directory   # any meaningful name
            
                 [Desktop Entry]
                 Type=Directory
                 Name=Docu & Admin             # you see THIS name in the
                 Name[de]=Doku + Admin         # panel sub-sub-menu
                 Name[fr]=.....
                 Icon=/home/<user>/.gnome/apps/StarOffice-7/icons/folder.png
                 Terminal=0
         
       ° as ROOT create symbolic Link in global *.directory dir to local dir:
            $ su
            $ cd /usr/share/desktop-menu-files
            $ ln -s /home/<user>/.gnome/apps/   \
                     menu-files/StarOffice7-DocuAdmin.directory  \
                      ./StarOffice7-DocuAdmin.directory
       


   (3) Edit The *.desktop Files
       ----------------------------
       Edit for every launcher-object you want in this sub-submenu a file
       [name].desktop, where the file-name is free.
       For locally use save they also to an user dir [searchpath] as defined
       in the applications-menu file:
            <MergeDir>/home/ksa/.gnome/apps/StarOffice-7</MergeDir>
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       ° as <USER> create local directory e.g.
            $ mkdir ~/.gnome/apps/StarOffice-7
            $ cd    ~/.gnome/apps/StarOffice-7
       ° If NO Launcher Object exist:
         create a NEW file [name].directory; name can be any meaningful token
         because system search is done only by inspcting 'Categories'.
            $ [edit] ./StarOffice7-DocuAdmin.directory   # any meaningful name
       
                 Name=Docu & Admin             # you see THIS name in the
                 Name[de]=Doku + Admin         # panel sub-sub-menu
                 Name[fr]=.....                # in French
                 Comment=Applications          # tip-text
                 Comment[da]=Programmer        # in french -> locale
                 Comment[de]=Anwendungen       # in german
                 Terminal=false                # run not in a terminal
                 Icon=/home/<user>/.gnome/apps/StarOffice-7/icons/draw.png
                 Exec=/home/<user>/opt/appl/staroffice7/program/sdraw
                 Type=Application                  
                 Categories=Application;sOffice-7;
                                           ^-- see file applications.menu
                                               <Keyword>sOffice7-Doc</Keyword>
                                               
       ° If a launcher-obj / *.desktop file exist:
         If you have a *.desktop of your application, or if you created a
         launcher-obj with your GUI (creates also a *.desktop file)
         you have to check and edit:
         - path of 'Icon' + 'Exec' attributes
         - 'Categories' is your Keyword token (file applications.menu)
            included

I hope that help others a bit.

Kurt




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux