[K12OSN] Definitive guide to editing gnome menus?

bimal pandit bimalp at indoasian.com
Tue Oct 26 12:54:31 UTC 2004


try the attached file's method, i did this and is working perfectly!!

bimal

On Tue, 2004-10-26 at 17:14, Debbie Schiel wrote:
> Hi all,
> 
> Does anyone have *the* guide to editing the 'start menu'?
> 
> I'm using the k12ltsp 4.1.0 install (Fedora Core 2) and the default 
> out-of-the-box session (gnome??).
> 
> I have tried the methods described on the Gnome.org/learn site, and 
> followed suggestions from previous posts in k12osn, without luck. I have 
> somehow been able to *add* to the menu - but they're duplicates of what 
> is already there... I don't want to delete the apps, just make them 
> unavailable to groups/users.
> 
> Going on my past experiences, I reckon I would probably get there in the 
> end, but tips and advice could make my 'journey' a lot shorter. (They're 
> also very encouraging!)
> 
> Thanks,
> 
> Debbie
-------------- next part --------------
<?xml version="1.0"?>
<VFolderInfo>  

  
  <!-- where desktop files are supposed to live -->
  <MergeDir>/usr/share/applications</MergeDir>

  <!-- For now, load up the legacy .desktop trees -->
  <MergeDir>/etc/X11/applnk</MergeDir>
  <MergeDir>/usr/share/gnome/apps</MergeDir>
  <MergeDir>/usr/share/applnk</MergeDir>

  <!-- Control panel dirs -->
  <MergeDir>/usr/share/control-center-2.0/capplets/</MergeDir>
  <MergeDir>/usr/share/gnome/capplets/</MergeDir>

  <DesktopDir>/usr/share/desktop-menu-files</DesktopDir>


    <!-- Root folder -->
  <Folder>
    <Name>Applications</Name>
    <Desktop>Applications.directory</Desktop>
    <Exclude>gnome-search-tool.desktop</Exclude>
    <Exclude>gnome-network-scheme.desktop</Exclude>

    <Query>
      <And>
        <Keyword>Core</Keyword>
	<Not>
	  <Keyword>Merged</Keyword>
        </Not>
      </And>
    </Query>


 <!-- Internet -->
    <Folder>
      <Name>Internet</Name>
      <Desktop>Internet.directory</Desktop>
      <Exclude>redhat-web.desktop</Exclude>
      <Exclude>net-gaim.desktop</Exclude>
      <Exclude>redhat-gnomemeeting.desktop</Exclude>
      <Query>
        <And>
          <Keyword>X-Red-Hat-Base</Keyword>
          <Keyword>Application</Keyword>
          <Keyword>Network</Keyword>
        </And>
      </Query>
      <DontShowIfEmpty/>
    </Folder>


<!-- MediaPlayer -->
 <Folder>
      <Name>MediaPlayer</Name>
      <Desktop>MediaPlayer.directory</Desktop>
      <Include>mediaplayer.desktop</Include>
     <DontShowIfEmpty/>
    </Folder>
 

 <!-- Office -->
    <Folder>
      <Name>Office</Name>
      <Desktop>Office.directory</Desktop>
      <Exclude>redhat-drawing.desktop</Exclude>
      <Exclude>redhat-diagrams.desktop</Exclude>
      <Exclude>redhat-math.desktop</Exclude>
      <Exclude>openoffice-printeradmin.desktop</Exclude>
      <Exclude>codefactory-mrproject.desktop</Exclude>
      <Query>
	<And>
          <Keyword>X-Red-Hat-Base</Keyword>
	  <Keyword>Application</Keyword>
	  <Or>
	   <Keyword>Office</Keyword>
<!--	    <Keyword>Spreadsheet</Keyword>
	    <Keyword>WordProcessor</Keyword>  -->
	  </Or>       
	</And>
      </Query>
     <DontShowIfEmpty/>
    </Folder>

 <!-- Other -->
    <Folder>
      <Name>Other</Name>
      <Desktop>Other.directory</Desktop>
      <OnlyUnallocated/>
        <Query>
          <And>
            <Keyword>Application</Keyword>
            <Not>
              <Or>
                <Keyword>Settings</Keyword>
                <Keyword>X-Red-Hat-Base-Only</Keyword>
                <Keyword>X-Red-Hat-Base</Keyword>
              </Or>
            </Not>
          </And>
        </Query>
                                                                                         
        <DontShowIfEmpty/>
    </Folder>
                                                                                         
  </Folder> <!-- All Applications -->


</VFolderInfo>
-------------- next part --------------
This is the customization process for a user "user1" in gnome environment

i took help from "http://www.bluethingy.com/linux/rh8menu.html" site a lot of thanks to 

mknepher at bluethingy.com(in fact his name was not there!!)

i am using redhat linux 9.0 with gnome2

Why?
----
In fact i had installed LTSP server and wanted that the gnome desktop should be customized per user, as i searched the net and got a few valuable links(like above) which helped me to get my work done, so i thought to give back "The NET Community" so that they can get releif while doing the same task.


How I did This?
---------------

[root at localhost root]# useradd user1

[root at localhost root]# passwd ******
< do confirmation >

[root at localhost root]# cd /home/user1/.gnome2

NOTE:- IN CASE YOU DON'T GET THIS DIRECTORY DON'T GET PANICKED, AS THIS MEANS YOU DID'NT LOGGED IN AS THIS USER SO JUST LOGIN AS THIS USER(user1) ONCE AND THIS AND OTHER DIRECTORIES WILL GET CREATED AUTOMATICALLY!!

[root at localhost .gnome2]# mkdir -p vfolders/applications

[root at localhost .gnome2]# cd vfolders

[root at localhost vfolders]# cp /etc/X11/desktop-menus/applications.menu  applications.vfolder-info

NOTE:- this is "applications.vfolder-info" and NOT "applications.vfolders-info" 

[root at localhost vfolders]# cd applications

[root at localhost applications]# cp  /usr/share/applications/*.desktop  .

NOTE:- i.e copy "/usr/share/applications/*.desktop" in this(applications) directory

[root at localhost applications]# cd ..

[root at localhost vfolders]# vi applications.vfolder-info

AND EDIT AS PER YOUR REQUIREMENT!!

HERE I AM GIVING MY CUSTOMIZED ENTRIES WHICH REDUCED THE DESKTOP MENU TO A GREAT EXTANT!!

CONTENTS OF "applications.vfolder-info"

************************* YOU CAN CUT AND PASTE BELOW GIVEN ENTRIES ******************************

<?xml version="1.0"?>
<VFolderInfo>  
  
  <!-- where desktop files are supposed to live -->
  <MergeDir>/usr/share/applications</MergeDir>

  <!-- For now, load up the legacy .desktop trees -->
  <MergeDir>/etc/X11/applnk</MergeDir>
  <MergeDir>/usr/share/gnome/apps</MergeDir>
  <MergeDir>/usr/share/applnk</MergeDir>

  <!-- Control panel dirs -->
  <MergeDir>/usr/share/control-center-2.0/capplets/</MergeDir>
  <MergeDir>/usr/share/gnome/capplets/</MergeDir>

  <DesktopDir>/usr/share/desktop-menu-files</DesktopDir>


    <!-- Root folder -->
  <Folder>
    <Name>Applications</Name>
    <Desktop>Applications.directory</Desktop>
    <Exclude>gnome-search-tool.desktop</Exclude>
    <Exclude>gnome-network-scheme.desktop</Exclude>

    <Query>
      <And>
        <Keyword>Core</Keyword>
	<Not>
	  <Keyword>Merged</Keyword>
        </Not>
      </And>
    </Query>


 <!-- Internet -->
    <Folder>
      <Name>Internet</Name>
      <Desktop>Internet.directory</Desktop>
      <Exclude>redhat-web.desktop</Exclude>
      <Exclude>net-gaim.desktop</Exclude>
      <Exclude>redhat-gnomemeeting.desktop</Exclude>
      <Query>
        <And>
          <Keyword>X-Red-Hat-Base</Keyword>
          <Keyword>Application</Keyword>
          <Keyword>Network</Keyword>
        </And>
      </Query>
      <DontShowIfEmpty/>
    </Folder>
 

 <!-- Office -->
    <Folder>
      <Name>Office</Name>
      <Desktop>Office.directory</Desktop>
      <Exclude>redhat-drawing.desktop</Exclude>
      <Exclude>redhat-diagrams.desktop</Exclude>
      <Exclude>redhat-math.desktop</Exclude>
      <Exclude>openoffice-printeradmin.desktop</Exclude>
      <Exclude>codefactory-mrproject.desktop</Exclude>
      <Query>
	<And>
          <Keyword>X-Red-Hat-Base</Keyword>
	  <Keyword>Application</Keyword>
	  <Or>
	   <Keyword>Office</Keyword>
<!--	    <Keyword>Spreadsheet</Keyword>
	    <Keyword>WordProcessor</Keyword>  -->
	  </Or>       
	</And>
      </Query>
     <DontShowIfEmpty/>
    </Folder>

<!-- Graphics -->
    <Folder>
      <Name>Graphics</Name>
      <Desktop>Graphics.directory</Desktop>
      <Include>net-xpdf.desktop</Include>
        <DontShowIfEmpty/>
      </Folder>

<!-- Other -->
    <Folder>
      <Name>Other</Name>
      <Desktop>Other.directory</Desktop>
      <OnlyUnallocated/>
        <Query>
          <And>
            <Keyword>Application</Keyword>
            <Not>
              <Or>
                <Keyword>Settings</Keyword>
                <Keyword>X-Red-Hat-Base-Only</Keyword>
                <Keyword>X-Red-Hat-Base</Keyword>
              </Or>
            </Not>
          </And>
        </Query>
                                                                                         
        <DontShowIfEmpty/>
    </Folder>
                                                                                         
  </Folder> <!-- All Applications -->


</VFolderInfo>

************************** YOU CAN CUT AND PASTE ABOVE ENTRIES *******************************

one should also remember that there may be some link file(s) (of additionally installed packages) , so you need to create that link accordingly as i did :-

ln -s     /usr/share/desktop-menu-patches/redhat-drawing.desktop /home/user1/.gnome2/vfolders/applications/redhat-drawing.desktop
                                                                                                                             
ln -s     /usr/share/desktop-menu-patches/redhat-email.desktop /home/user1/.gnome2/vfolders/applications/redhat-email.desktop                                                                                                                             
ln -s     /usr/share/desktop-menu-patches/redhat-math.desktop /home/user1/.gnome2/vfolders/applications/redhat-math.desktop
                                                                                                                             
ln -s     /usr/share/desktop-menu-patches/redhat-presentations.desktop /home/user1/.gnome2/vfolders/applications/redhat-presentations.desktop
                                                                                                                             
ln -s     /usr/share/desktop-menu-patches/redhat-spreadsheet.desktop /home/user1/.gnome2/vfolders/applications/redhat-spreadsheet.desktop
                                                                                                                             
ln -s     /usr/share/desktop-menu-patches/redhat-web.desktop /home/user1/.gnome2/vfolders/applications/redhat-web.desktop
                                                                                                                             
ln -s     /usr/share/desktop-menu-patches/redhat-word-processor.desktop /home/user1/.gnome2/vfolders/applications/redhat-word-processor.desktop


in case you may not be knowing the name of the menu/submenu as to which you want to exclude, as the actual name may be different to the what you are getting in the menu e.g.

in the main menu under "internet" menu you will see "Mozilla Web Browser" while in applications directory(that you created) you wont find any thing, even containing this name(Mozilla) so the way out is just hover your curser on that menu and see what is the "comment" it is showing to you as in this example, when you hover the curser over "Mozilla Web Browser" you will get "Browse the internet" message/comment so just do

[root at localhost applications]# grep "Browse the Internet" * 

this will give you

redhat-web.desktop:Comment=Browse the Internet

so you have to exclude "redhat-web.desktop"

similarly can search and include/exclude others!!

So far i hope this will help atleast one person in this world !!
well i am not a programmer and XML is a black box for me so no help in this matter, i am just a linux enthusiast!!

Bimal Pandit



NOTE:-

pls mail me in case someone need further help and if i can i will!!

here are my email id's :- bimalp at indoasian.com, hello_bee at rediffmail.com, hello_bee at indiatimes.com


other useful link
http://gnome.org/learn/

-------------- next part --------------
HOW ACTUALLY I FOUND THIS AND COPIED AND EDITED THESE !!
--------------------------------------------------------

[root at cluster01 vfolders]# locate Office.directory

/usr/share/desktop-menu-files/Office.directory
/usr/share/gnome/vfolders/Office.directory

[root at cluster01 vfolders]# cp /usr/share/desktop-menu-files/Office.directory /usr/share/desktop-menu-files/MediaPlayer.directory

[root at cluster01 vfolders]# vi /usr/share/desktop-menu-files/MediaPlayer.directory

[root at cluster01 vfolders]# cp /usr/share/desktop-menu-files/MediaPlayer.directory /usr/share/gnome/vfolders/                                                                                                                             

==================================================================================================

[root at cluster01 applications]# vi mediaplayer.desktop

[Desktop Entry]
Name=Media Player
Encoding=UTF-8
Comment=play your audio files
Exec=/usr/bin/xmms
Terminal=0
Type=Application
Icon=gnome-audio2.png
Categories=Application;Network;X-Red-Hat-Extras;


[root at cluster01 applications]# cd ..

[root at cluster01 applications]# vi applications.vfolder-info

<!-- MediaPlayer -->
 <Folder>
      <Name>MediaPlayer</Name>
      <Desktop>MediaPlayer.directory</Desktop>
      <Include>mediaplayer.desktop</Include>
     <DontShowIfEmpty/>
    </Folder>

[root at cluster01 applications]# vi /usr/share/desktop-menu-files/MediaPlayer.directory

[Desktop Entry]
Name=MediaPlayer
Comment=Play your Audiio files
Icon=gnome-audio2.png
Type=Directory


[root at cluster01 applications]# cp /usr/share/desktop-menu-files/MediaPlayer.directory /usr/share/gnome/vfolders/

NOTE:- ACTUALLY ALL THE ICONS ARE LOCATED AT "/user/share/pixmaps/*.png" SO YOU NEED TO CHOOSE YOUR ICON AND JUST PUT ITS NAME, FOR SHORTCUT JUST CLICK RIGHT BUTTON OF YOUR MOUSE ON DESKTOP AREA AND SELECT "new launcher" THEN CLICK ON "no icon" THIS WILL GIVE A LIST OF ALL ICONS WITH THEIR PICTURES!!

==================================================================================================

FIRST MOVE TO "vfolders" DIRECTORY AND EDIT THIS

[root at cluster01 vfolders]# vi applications.vfolder-info

 <!-- Internet -->
    <Folder>
      <Name>Internet</Name>
      <Desktop>Internet.directory</Desktop>
      <Include>mozilla-mail-client.desktop</Include>
      <Exclude>redhat-web.desktop</Exclude>
      <Exclude>redhat-gnomemeeting.desktop</Exclude>
      <Query>
        <And>
          <Keyword>X-Red-Hat-Base</Keyword>
          <Keyword>Application</Keyword>
          <Keyword>Network</Keyword>
        </And>
      </Query>
      <DontShowIfEmpty/>
    </Folder>


[root at cluster01 vfolders]# cd applications

[root at cluster01 applications]# vi mozilla-mail-client.desktop

[Desktop Entry]
Name=Mozill Mail
Encoding=UTF-8
Comment=mozilla mail client
Exec=/usr/bin/mozilla -mail
Terminal=0
Type=Application
Icon=gnome-balsa2.png
Categories=Application;Network;X-Red-Hat-Extras;
                                                                                                                             


More information about the K12OSN mailing list