Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: edit Gnome 2.10 menu's
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
taipan67
l33t
l33t


Joined: 04 Dec 2004
Posts: 866
Location: England (i'm told...)

PostPosted: Sat Jul 02, 2005 8:21 pm    Post subject: HOWTO: edit Gnome 2.10 menu's Reply with quote

If you're reading this, it's because, like me, you've installed Gnome-2.10 & discovered that you can't edit the drop-down menu's any more. There are a number of posts littered about the forums which mention the techniques i discovered the hard way, but i thought i'd try to create something that would be easier to find... :roll:

The first thing to do is
Code:
emerge smeg

...which is the 'Simple Menu Editor for Gnome (in case you're a 'Red Dwarf' fan & already know better). As of this writing, it's keyword-masked, so it may need an entry in /etc/portage/package.keywords, as well as any similarly masked dependencies.

EDIT: As pointed out by steve_d555 later in this thread, it may also involve updating 'python', in which case, be sure to run 'python-updater' as well.

While this tool works extremely well, i've found that it has a couple of short-comings; 1st, it only works on the 'Applications' menu, omitting the 'Places' & 'Desktop' menu's. 2nd, it won't allow me to add main categories to the 'Applications' menu, if they're not already highlighted. Here's how i overcame the problem...

Every menu-item on your desktop has a corresponding '.desktop' file located in the /usr/share/applications/ directory. They're a tad confusing, as their names appear differently depending on whether you list them in 'nautilus' or 'gnome-terminal'. If you view one of the existing ones in a terminal with the 'less' command, you'll find that the 'Name'-field is what's listed by 'nautilus'.

To demonstrate the technique, here are two examples.

First, i found when i installed 'games-arcade/emilia-pinball' that i didn't get a menu-entry when i logged out & logged back in. So i fired up 'smeg' to do it manually... That's when i discovered that i couldn't add the main 'Games' sub-menu with it by clicking the check-box.

Much rooting around unearthed the /usr/share/applications/ directory, & a bit of trial-&-error produced the desired results - here's my pinball.desktop file :-
Code:
[Desktop Entry]
Encoding=UTF-8
Name=Emilia Pinball
Comment=Arcade-type pinball game
Exec=pinball
Icon=/usr/share/games/pinball/pinball.xpm
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;Application;Game;


Logging out & in got me the desired menu-entry in the desired sub-menu. The next problem was how to tackle the other two main menu's, 'Places' & 'Desktop'. Here's a file i created to give myself a menu-entry for the 'xscreensaver' configuration-tool, & place it in the 'Desktop ---> Preferences' sub-directory (i cunningly called it 'xscreensaver.desktop') :-
Code:
[Desktop Entry]
Encoding=UTF-8
Name=Screensaver
Comment=Configure screensaver settings
Exec=xscreensaver-demo
Icon=xscreensaver
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;Application;Settings;

The key to manipulating these files seems to be the 'Categories' section. The best reference i've managed to find thus far is in the /usr/share/scrollkeeper/Templates/ directory. There are several locale-specific sub-directories in there - i found an English version in the 'C' sub-directory, called 'scrollkeeper_cl.xml'. It doesn't seem to matter if the categories are pluralised or not, but by all means experiment & see what you can do with it... :P

You might also have noted the difference between the 'Icon' entries of the two examples. I've come to the assumption that 'Gnome' looks for such things along a pre-defined path, so in the case of the 'xscreensaver' icon, it resides in /usr/share/pixmaps/, along with all the other standard ones, & was therefore found without the need to get explicit. 8)

I hope this proves helpful to other 'Gnome-2.10' users, & also that the many people who've already passed on these or similar tips won't take offense to my neglecting to list them as credits (i figured this out for myself, & i'm too lazy to search for them all, anyway). :oops:
_________________
"Anyone who goes to see a psychiatrist should have their head examined!"


Last edited by taipan67 on Sun Jul 03, 2005 8:45 pm; edited 3 times in total
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5711
Location: Removed by Neddy

PostPosted: Sat Jul 02, 2005 9:13 pm    Post subject: Reply with quote

SMEG-HEAD
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
taipan67
l33t
l33t


Joined: 04 Dec 2004
Posts: 866
Location: England (i'm told...)

PostPosted: Sat Jul 02, 2005 9:23 pm    Post subject: Reply with quote

Naib wrote:
SMEG-HEAD

With that observation, i'd have you down as a Scouser rather than a Brummie! :wink:

So does it mean the tips helped, or that i'm doomed to a re-location to 'Duplicate Threads'? 8O

Initial post subtly edited just for you! :twisted:
_________________
"Anyone who goes to see a psychiatrist should have their head examined!"
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5711
Location: Removed by Neddy

PostPosted: Sun Jul 03, 2005 10:47 am    Post subject: Reply with quote

lol na biig Red Dwarf fan,

na tip is good, just impressed there is a package called "smeg" - ok me a big geek
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
tkhobbes
Guru
Guru


Joined: 12 Nov 2004
Posts: 367
Location: Switzerland

PostPosted: Sun Jul 03, 2005 10:59 am    Post subject: Reply with quote

Thanks for this little documentation - I ended up with messy GNOME 2.10 menus and wanted to change them - and someone gave me the "SMEG" hint.

However, smeg depends on Python >= 2.4 - which causes some other programs not to work correctly, namely gdesklets!
That's why I rolled back to Python 2.3.whatever, and I still have messy menus. :(

I don't understand why the Gnome developers gave up the "Applications:///" thingy - that was all I needed... :(

thomas
_________________
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Back to top
View user's profile Send private message
steve_d555
Guru
Guru


Joined: 07 Nov 2004
Posts: 458
Location: Belmont, Massachusetts

PostPosted: Sun Jul 03, 2005 12:11 pm    Post subject: Reply with quote

tkhobbes wrote:
Thanks for this little documentation - I ended up with messy GNOME 2.10 menus and wanted to change them - and someone gave me the "SMEG" hint.

However, smeg depends on Python >= 2.4 - which causes some other programs not to work correctly, namely gdesklets!
That's why I rolled back to Python 2.3.whatever, and I still have messy menus. :(

I don't understand why the Gnome developers gave up the "Applications:///" thingy - that was all I needed... :(

thomas


You probably needed to run python-updater after installing python-2.4. Since 2.4 is in a different dir all your old python apps are looking in the wrong place. Happened to me with a couple apps.
_________________
rubyforums | blog | boxwhore
Back to top
View user's profile Send private message
taipan67
l33t
l33t


Joined: 04 Dec 2004
Posts: 866
Location: England (i'm told...)

PostPosted: Sun Jul 03, 2005 6:26 pm    Post subject: Reply with quote

steve_d555 wrote:
You probably needed to run python-updater after installing python-2.4. Since 2.4 is in a different dir all your old python apps are looking in the wrong place. Happened to me with a couple apps.

Good call, steve! My system's compiled from scratch, rather than updated, so i didn't know that. :oops:

It'd be nice if the dev's could arrange for that python-update to happen automatically, particularly as 'portage' depends on it... :roll:

Initial post edited accordingly. :wink:
_________________
"Anyone who goes to see a psychiatrist should have their head examined!"
Back to top
View user's profile Send private message
BennyP
Guru
Guru


Joined: 09 May 2003
Posts: 497
Location: Toronto, Canada

PostPosted: Mon Aug 22, 2005 10:08 pm    Post subject: Reply with quote

I installed python2.4, then i changed python symlink to python2.3 because emerge was broken, then i reda about python-updater and ran it, smeg still doesn't work though

Code:
benny@outoforder ~/menueditor $ sudo ln -sf /usr/bin/python2.4 /usr/bin/python
Password:
benny@outoforder ~/menueditor $ sudo python-updater
Traceback (most recent call last):
  File "/usr/bin/portageq", line 10, in ?
    import portage,types,string
  File "/usr/lib/portage/pym/portage.py", line 7140, in ?
    portdb=portdbapi(settings["PORTDIR"])
  File "/usr/lib/portage/pym/portage.py", line 5125, in __init__
    self.eclassdb = eclass_cache(self.porttree_root, self.mysettings)
  File "/usr/lib/portage/pym/portage.py", line 4968, in __init__
    self.dbmodule = self.settings.load_best_module("eclass_cache.dbmodule")
  File "/usr/lib/portage/pym/portage.py", line 1220, in load_best_module
    return load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 139, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 21, in ?
    import cdb
ImportError: No module named cdb
Traceback (most recent call last):
  File "/usr/bin/portageq", line 10, in ?
    import portage,types,string
  File "/usr/lib/portage/pym/portage.py", line 7140, in ?
    portdb=portdbapi(settings["PORTDIR"])
  File "/usr/lib/portage/pym/portage.py", line 5125, in __init__
    self.eclassdb = eclass_cache(self.porttree_root, self.mysettings)
  File "/usr/lib/portage/pym/portage.py", line 4968, in __init__
    self.dbmodule = self.settings.load_best_module("eclass_cache.dbmodule")
  File "/usr/lib/portage/pym/portage.py", line 1220, in load_best_module
    return load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 139, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 21, in ?
    import cdb
ImportError: No module named cdb
 * Unable to proceed. Can not find PORTDIR. Make sure the command:
 *
 *   portageq portdir
 *
 * returns a value. If it doesn't, make sure you have updated to
 * latest portage version.
 *
 * Report bugs to http://bugs.gentoo.org/
benny@outoforder ~/menueditor $ portageq portdir
Traceback (most recent call last):
  File "/usr/bin/portageq", line 10, in ?
    import portage,types,string
  File "/usr/lib/portage/pym/portage.py", line 7140, in ?
    portdb=portdbapi(settings["PORTDIR"])
  File "/usr/lib/portage/pym/portage.py", line 5125, in __init__
    self.eclassdb = eclass_cache(self.porttree_root, self.mysettings)
  File "/usr/lib/portage/pym/portage.py", line 4968, in __init__
    self.dbmodule = self.settings.load_best_module("eclass_cache.dbmodule")
  File "/usr/lib/portage/pym/portage.py", line 1220, in load_best_module
    return load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 139, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 21, in ?
    import cdb
ImportError: No module named cdb
benny@outoforder ~/menueditor $

_________________
Could it be?
Back to top
View user's profile Send private message
taipan67
l33t
l33t


Joined: 04 Dec 2004
Posts: 866
Location: England (i'm told...)

PostPosted: Tue Aug 23, 2005 12:42 am    Post subject: Reply with quote

BennyP wrote:
I installed python2.4, then i changed python symlink to python2.3 because emerge was broken, then i read about python-updater and ran it, smeg still doesn't work though...

To my limited understanding, i'd say python still ain't fixed. With that in mind, it might be worth seeing if 'revdep-rebuild' could help - it's part of 'gentoolkit', but i've never used it myself, so a forum-search would be advised...

...Also, as the author of this thread, i feel a confession is in order - i've junked Gnome-2.10 & installed 'kdebase-startkde'. I'm afraid that, for me, menu-editing turned out to be just the tip of the iceberg, when it came to issues with this release... :evil:

...Maybe, if 2.12 solves as many problems as it's rumoured to, i'll switch back, come September... :roll:
_________________
"Anyone who goes to see a psychiatrist should have their head examined!"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum