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.😀