Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: HowTo: Customizable Right/Middle Click Menu in Gnome

  1. #1
    Join Date
    Oct 2005
    Beans
    170
    Distro
    Ubuntu Development Release

    HowTo: Customizable Right/Middle Click Menu in Gnome

    I'm a recent transfer from an XP system where I was running litestep. For those of you who don't know, litestep has an easily customizable right click menu that basically supplanted the standard windows start menu. This made getting a customizable menu in Gnome a pretty big priority for me.

    Now there are four main ways I found to add this functionality to Gnome nautilus-scripts, nautilus-actions, mygtkmenu (compiz-deskmenu too, but mygtkmenu seems better), and the main gnome menu (my favorite of the four).

    I'm currently using mygtkmenu because the main gnome menu is inaccessible without running gnome-panel.

    nautilus-scripts


    Just write a script for the desired action, make it executable, and place the script in
    Code:
    ~/.gnome2/nautilus-scripts/
    A script submenu will then appear in the right click menu when clicking anywhere in nautilus.


    nautilus-actions
    For this one, we need to start out by installing a new package, nautilus-actions, so open up a terminal and enter:
    Code:
    sudo apt-get install nautilus-actions
    Then to configure the addons to the right-click menu, just enter
    Code:
    nautilus-actions-config
    The menu for adding items is fairly straightforward, but if we want certain items to only show up when right-clicking the desktop, we need to add
    Code:
    x-nautilus-desktop
    under the advanced conditions tab and only click that. Also check Only folders if we don't want this item to show up when clicking on files in the desktop.



    Items here appear in the main right-click menu (as seen in the nautilus-scripts image).

    mygtkmenu



    We first need to download and extract mygtkmenu:

    Code:
    mkdir .mygtkmenu2
    cd .mygtkmenu2
    wget http://sites.google.com/site/jvinla/myGtkMenu-1.2.1c.tar.gz?attredirects=0 -O mygtkmenu.tar.gz
    tar -zxvf mygtkmenu.tar.gz
    rm mygtkmenu.tar.gz
    Now, download the attached menu file (menu.txt) and put it in the same directory. At the bottom of the file (lines 115/116) change yournamehere to your username. Editing this file is very simple and the instructions are included in the comments.

    To make this menu show up we need to make some changes in the compiz settings. To bring this up, simply open a terminal and enter
    Code:
    ccsm
    Now we just need to map this to the right mouse button. When in ccsm, click on general options and go under the commands tab and commands dropdown menu. Click on one of these that's unused and set it to:
    /home/yournamehere/.mygtkmenu/myGtkMenu /home/yournamehere/.mygtkmenu/menu.txt

    Now go to Viewport switcher and set the Plugin for initiate action to "commands" ("core" for newer versions of Compiz) and the action name for initiate to "run_command#_key", where # is the number of the command corresponding to mygtk2menu. Change initiate plugin action key to Button 3 and now the right mouse button should popup the mygtkmenu. To bring up the gnome menu, hold control as you right-click. To edit the menu, just click on the edit item in the menu.

    Gnome right-click menu

    Notice that when you hit Alt+F1 and there's no menu launcher on the panel, the menu opens at your cursor. What we do here is link the right click on the desktop to the key combination Alt+F1

    Here's how it's done: download the 'xautomation' package:
    Code:
    sudo aptitude install xautomation
    Then bring up compiz settings manager with:
    Code:
    ccsm
    Go to the commands page and and set up a command as:
    Code:
    xte "keydown Alt_L" && xte "key F1" && xte "keyup Alt_L"
    Now go to Viewport switcher and set the Plugin for initiate action to "commands" ("core" for older versions of Compiz) and the action name for initiate to "run_command#_key", where # is the number of the command corresponding to xautomation. Change initiate plugin action key to Button 3 and now the right mouse button should popup the compiz deskmenu. To get the gnome right-click menu back, simply hold command when right-clicking

    EDIT: In Jaunty, set "Plugin for initiate action" to "commands".
    Attached Files Attached Files
    Last edited by quazi; January 25th, 2010 at 09:51 PM. Reason: Jaunty changes things.

  2. #2
    Join Date
    Oct 2007
    Beans
    92
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    I tried the nautilus-scripts method, but I do not see the Scripts submenu when I right click anywhere. Any thoughts?

  3. #3
    Join Date
    Oct 2005
    Beans
    170
    Distro
    Ubuntu Development Release

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Make sure your scripts are located in
    Code:
    /home/(your home folder)/.gnome2/nautilus-scripts
    and are executable (under the permissions tab in the properties menu).

    I'm not sure why this would be the case, but it's possible you might need to set the permissions so your account can access the scripts. To do this, go to the nautilus-scripts directory and run
    Code:
    sudo chmod 755 *
    .
    Last edited by quazi; August 10th, 2008 at 03:15 AM.

  4. #4
    Join Date
    Aug 2008
    Location
    germany
    Beans
    857

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Thanks, compiz deskmenu works just fine.=D>

  5. #5
    Join Date
    Oct 2005
    Beans
    170
    Distro
    Ubuntu Development Release

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Compiz-deskmenu does have a big drawback in that it doesn't automatically generate menu items, but does have a simple editor very similar to alacarte.

    Anyway, to save some time for other users, here's my deskmenu xml file. It belongs in ~/.config/compiz/deskmenu/

    It's an xml file, but I had to rename it to zip because of the strange rules of this forum's attachments.
    Attached Files Attached Files

  6. #6
    Join Date
    Oct 2007
    Beans
    174

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Is there a way to add the Gnome menu (or the Application/Places/Admin menus) to the right click?

  7. #7
    Join Date
    Apr 2009
    Beans
    10

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Does Nautilus-Actions work in 8.10? I've installed it, and tried to add something ... anything. Nothing works.

    The install went fine.
    I opened up the panel.
    I tried to add firefox (to test), making the windows match what you've posted.
    No luck. I've even restarted nautilus and rebooted my system.

    Any suggestions?

  8. #8
    Join Date
    Jul 2008
    Location
    Lost River Lake
    Beans
    233
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Thank you quazi!

    I have grown so used to Openbox — and so fond of it, too — that when I wanted to try Gnome for a change, after quite a while, I kept forgetting that I cannot open a menu by just right-clicking on the desktop. So a moment ago I searched for instructions for installing Compiz-Deskmenu and found yours.

    Now I'm having fun — and better able to work — also with Gnome again!
    I never use smilies, but there are exceptions that prove the rule [Hey, how do I disable showing colon & parenthesis as an emoticon in my signature?]
    Now playing: Last.fm

  9. #9
    Join Date
    Oct 2005
    Beans
    170
    Distro
    Ubuntu Development Release

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Quote Originally Posted by rick71 View Post
    Is there a way to add the Gnome menu (or the Application/Places/Admin menus) to the right click?
    EDIT: Yes there is.

    Anyway, download the 'xautomation' package:
    Code:
    sudo aptitude install xautomation
    and set up the command in compiz as
    Code:
    xte "keydown Alt_L" && xte "key F1" && xte "keyup Alt_L"
    Then follow the instructions in the Compiz-deskmenu section to hook up the right mouse button to that command.

    Quote Originally Posted by rppp01a View Post
    Does Nautilus-Actions work in 8.10? I've installed it, and tried to add something ... anything. Nothing works.

    The install went fine.
    I opened up the panel.
    I tried to add firefox (to test), making the windows match what you've posted.
    No luck. I've even restarted nautilus and rebooted my system.

    Any suggestions?
    I don't know, it seems kind of finicky (I honestly haven't used it all that much, I prefer compiz-deskmenu). I've gotten it to work in 9.04, so I would suspect it works in 8.10.

    I've attached what I did to get it to work.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot.jpg 
Views:	118 
Size:	70.5 KB 
ID:	109426  
    Last edited by quazi; April 11th, 2009 at 05:46 AM. Reason: Cool stuff

  10. #10
    Join Date
    Apr 2009
    Beans
    10

    Re: HowTo: Customizable Right/Middle Click Menu in Gnome

    Actually, I was having issues with sound, and for some reason it was causing this to not work. Works great now. Thank you!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •