2

I like the Linux-Mint 13 Mate Alt-F1 menu and the Alt-F2 run-dialog, but as soon as I installed Compiz those keys became non-functional.

Conpiz has a Gnome compaatibility settings panel which allows you to set these keys, but using that Compix settings panel did not make any diference (probably because Mate is not Gnome, strictly speaking)...

Is there some way to get those two shortcut keys back into acton with Compiz?

2 Answers 2

6

Alt+F2 from Mint forums http://forums.linuxmint.com/viewtopic.php?f=206&t=104169

In short (for those who want to skip reading the whole thread). Paste the code below into mate-run.c

#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>

void die(const char *message)
{
   fputs(message, stderr);
   exit(1);
}

Atom get_atom(Display *display, const char *atom_name)
{
   Atom atom = XInternAtom(display, atom_name, False);
   if (atom == None)
      die("can't find an atom I need");
   return atom;
}

int main()
{
   Display *display;
   Atom gnome_panel_atom, run_atom;
   XClientMessageEvent event;

   display = XOpenDisplay(NULL);
   if (display == NULL)
      die("can't open display");

   gnome_panel_atom = get_atom(display, "_MATE_PANEL_ACTION");
   run_atom = get_atom(display, "_MATE_PANEL_ACTION_RUN_DIALOG");

   event.type = ClientMessage;
   event.window = DefaultRootWindow(display);
   event.message_type = gnome_panel_atom;
   event.format = 32;
   event.data.l[0] = run_atom;
   event.data.l[1] = (Time)(time(NULL) * 1000);

   XSendEvent(display, event.window, False, StructureNotifyMask,
              (XEvent *)&event);

   XCloseDisplay(display);

   return 0;
}

Compile and install with:

$ gcc mate-run.c -o mate-run -L/usr/X11R6/lib -lX11
$ chmod 755 mate-run
$ sudo cp mate-run /usr/local/bin

and simply in CCSM > Commands add a command that links "mate-run" to "ALT+F2" key-combo.

Works in Maya x64 (I do have build-essentials and whatnot so you might want to check out what to install to have X11 libraries and gcc).

I deserve no credit for this other than discovering it in the forums.

2
  • 1
    Thanks Bojan. I works nicely, and I find it behaves better with this following extra bash step to focus it: mate-run; sleep .1; xdotool windowactivate $(wmctrl -lx | sed -nr 's/^([^ ]+).* mate-panel.Mate-panel .* Run Application/\1/p')
    – Peter.O
    Nov 2, 2012 at 8:11
  • Thanks, it is much better now since I often forget to click in the textfield and CCSM doesn't have Focus Protection Windows option any more. Also you might want to check this out as an elegant solution that solves both Alt+F1 and Alt+F2 issue with one executable that's equally easy to compile: forums.linuxmint.com/viewtopic.php?f=219&p=615178 Nov 3, 2012 at 13:15
0

As it seems there is no standard way to do it, I've written a script which enables Alt-F1 to open the main menu. It utilizes the Panel Applet Main Menu (the main MATE menu)

  • Add a New psanel applet: Main Menu
  • Make it the leftmost icon in the top panel. If you want a different position, change the first 'mousemove' accordingly, so that it clicks on your icon's screen-position.
  • Put this script somewhere in your PATH

    #!/bin/bash
    # name: mouse-click-screen
    { eval $(xdotool getmouselocation --shell)  # save current mouse position
      sleep .15               # It needs a delay (?!).. Your Mileage May Vary
      xdotool mousemove --sync ${1:-10} ${2:-10} click 1
      xdotool mousemove --sync $X $Y           # restore saved mouse position
    } 2>/dev/null
    
  • In System -> Preferences -> Keyboard Shortcuts, click ADD.
    Note that because compiz is the desktop manager, there is no clash with the previous Alt-F1)

    Name:     main-menu    
    Command:  mouse-click-screen
    Shortcut: Alt+F1
    

That's it. Alt+F2 is still pending. but at least Alt+F1 works. It isn't perfect, but it works pretty well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .