Since I switched to Ubuntu, I missed a Run Command dialog ala Windows. Somehow I think it lots neater than the “classic” terminal window. Actually the dialog is provided in Add To Panel dialog. But I don’t know why it can’t be placed on Gnome’s main menu. It kinds of a weird “policy” of Gnome, IMO. So, I started to google (yes, now google can be used as verb) about this issue. I found many people also miss the dialog.
Then, google took me to this blog. The blog owner has a small program to pop up Gnome’s Run Command dialog. As it’s a program, we are able to put its shortcut in the main menu. That’s just exactly what I need.
Happily I downloaded the source, compile it with gcc, and run it. As expected, it works. Still, there’s a but, a big but to me actually. The program is able to show the Run Command dialog but the window isn’t brought to the foreground. It’s very annoying! Logically, we expect a window would pop up in front of us each time we click on an application’s icon.
I uttered this problem on the blog. The blog owner suggested me to use an additional tool name Devilspie to manage Gnome’s window extra behavior. Personally, I don’t like this solution. I believe Gnome and X11 is a mature window manager with relatively complete features. Inability to bring up a window to the front sounds impossible.
So, I started to learn a little bit about x window and Gnome desktop programming. After about an hour googling around, fortunately, I found the solutions. There’s a tiny mistake on the program and it’s pretty easy to fix. But, instead of fix the c written program, I chose to re-write it in pascal using my favorite pascal compiler: FreePascal.
And here’s the pascal code…
|
|
Save it as gnome_run.pas. Compile it using fpc gnome_run.pas -CX -OG2 -XXs. Run it. Viola, the Run Command dialog popped up in front of me.
ยป Program shortcut on Ubuntu’s main menu.
Ok, I think it’s enough playing around with xlib and Gnome. It’s time to back to my real job.

November 30, 2007 at 11:27 pm |
poor gnome….
i just click “cassandra” – “run program” in my MintXFCE kekekekeke…….
December 4, 2007 at 1:14 am |
Thanks KDE for ALT-F2 Magic
http://www.kdedevelopers.org/node/658
December 4, 2007 at 2:11 am |
Ubuntu also has the Alt+F2 keyboard shortcut to launch this dialog. But that’s not the point. I want to launch the dialog by point-and-click on a (main-)menu item, using mouse, not using keyboard and the cryptic shortcut.
December 5, 2007 at 12:26 am |
Ahh
I see.The old (Gnome) problem of removing (useful) options
December 5, 2007 at 12:41 am |
That’s why I said it was a “weird” policy of Gnome. They remove Run Command dialog but still provide console/terminal.
April 24, 2009 at 10:46 am |
fuck pascal, can you post the C source code please?
April 24, 2009 at 11:39 am |
@steve:
aha, “nice” word! why don’t you help yourself first then!
August 6, 2009 at 3:09 pm |
Please indicate what you changed in the code. The only thing I could find was the client event data time information.
August 6, 2009 at 3:13 pm |
For those wanting the fix for C, add the following header
#include
Then change the second event data assigment to
event.data.l[1] = (Time)time(NULL);
HTH