Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When we right click the main menu on the panel we get some options. Is it possible to remove Edit Menus option from that?

share|improve this question
up vote 3 down vote accepted

Okay, this doesn't remove the menu entry, but it makes it useless, should be just what you need:

First, make a backup copy of alacarte, the menu editor:

sudo cp /usr/bin/alacarte /usr/bin/alacarte_backup

Now open up the original in your favourite text editor:

sudo gedit /usr/bin/alacarte

In between the end of the big comment on the top and the line that says import sys, paste this:

import gtk
md = gtk.MessageDialog(None, 
    gtk.BUTTONS_CLOSE, "Not Allowed")

You can of course replace "Not Allowed" with any error message you like.

Now when you click "edit menus", this message will pop up:

error message saying "not allowed"

Of course this is not 'secure', a knowledgeable user will be able to get around it, but I guess that's fine in your case. I also haven't tested if any other applications break because of it, but looking at the code, that shouldn't happen.

Note: if you want to use an error message consisting of characters outside of ASCII, make sure the it says
# -*- coding: utf-8 -*- at the top (second or third line, not the first) of the file (it should by default).
Otherwise you'll get an error.

share|improve this answer
Is it possible to completely remove that option? – karthick87 Apr 12 '11 at 14:01

Stefano and I have been talking about this in Chat today. I think he's working on another direction, but I've got a couple of source-based ways to work around this.

  1. The Main Menubar applet is part of gnome-panel so you could download the source for that, make your edits to remove the Edit Menus menu option and then repackage it. The problem with this is you'll either lose your changes when you get an update or you hold the package version and go without automatic updates.

  2. Use another sort of menu. There are some great options out there with things like Cardapio. Cardapio is Python based so it's a little easier to bend to your will. Just edit /usr/lib/cardapio/ You have a few options here, you can break launch_edit_app(). Or you can hunt down where the option gets drawn using something like this:

    grep -R 'launch_edit_app' /usr/lib/cardapio/

    Of course you'd want to lock down the panel to stop somebody just adding the regular menu.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.