Results 1 to 10 of 12

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

Threaded View

  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.

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
  •