Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to bring a window to top of the desktop?(if I know the pid) 1

Status
Not open for further replies.

julianLiuRsch

Programmer
Oct 4, 2008
11
For example, If I know the PID(4184) of a ``SciTE'' process, and now it is overlapped by other windows. Then how can I bring that SciTE window to the top of the desktop? (That is, ``in front of'' any other window, at the same time becoming an active window)
My system is Fedora8(x86_64), with gnome.
thanks in adv.
 
In your example, try:

Code:
$ fg 4184

Failing that, I have no idea!
 
fg (and bg) I think are for the command line... bg a process to get your prompt back and do other stuff while it's running and then fg it again for it to take control of your terminal again. (or Ctrl+Z pauses and backgrounds it and fg resumes it)... either way it doesn't affect the X window system.

Unless X or your desktop environment ships with any command-line app that lets you manipulate windows like that, you'd probably need to program it in a language that has bindings to the X server API (a Perl script using X11::GuiTest might work, if you know the title of the window... not sure if you can get the title based off the PID or not)


You already have Perl so you'd need to install X11::GUITest and then just write a quick script that uses it (you should be able to derive enough from the examples in the module documentation if you don't know any Perl).

-------------
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top