[K12OSN] Editing Gnome menus

bimal pandit bimalp at indoasian.com
Wed Aug 11 03:26:58 UTC 2004


dear all,

here is my document for your use...

hope this will help.

further dear Gavin, with reference to your mail saying as

"If anyone has any more HOWTOz please eMail me & ill do
my best to put them up where everyone can get @ them... "

i am sending this so that you can post it for EVERYBODY's HELP


regards

bimal

> Trond Mæhlum wrote:
> 
> >man, 09.08.2004 kl. 21.08 skrev Pete:
> >  
> >
> >>Trond Mæhlum wrote:
> >>
> >>    
> >>
> >>>Is there a simple way of editing the gnome start menu for all users? I 
> >>>would like to remove some programs, so that the users only have access 
> >>>to what they really need... This is on K12LTSP 4.0.1
> >>>
> >>>      
> >>>
> >>Depends on what version of gnome your using 2.4 or 2.6?
> >>    
> >>
> >
> >The one that came with K12LTSP 4.0.1 as default... Not sure if it's 2.4
> >or 2.6...
> >
> >Trond
> >
> >  
> >
> >>Peter
> >>    
> >>
> See the follow-up mails in
> http://mail.gnome.org/archives/gnome-list/2003-September/msg00036.html
> 
> 2.4 has a lot of ERRORS !
> 
> Items like "Run Application..." are hardcoded inside gnome 2.4
> 
> 
> Things are better in gnome 2.6 see gnome.org doc for latest menu stuff.
> 
> Peter
> 
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
-------------- 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/



More information about the K12OSN mailing list