[openbox] [maybe OT] raise window from CLI

Anthony Thyssen A.Thyssen at griffith.edu.au
Sun Oct 2 20:26:34 EDT 2011


On Sun, 2 Oct 2011 09:13:30 -0700
Roman Bogorodskiy <bogorodskiy at gmail.com> wrote:
|   Jorge Almeida wrote:
| 
| > My IDE for working with LaTeX is simply an xterm + gvim + a simple Makefile :)
| > "make edit" will call gvim to edit a tex file, "make" will produce a
| > pdf, "make view" will call evince to show the pdf file, etc. Now, when
| > evince is already running the appropriate file (i.e., assuming that
| > "make view" was already called), when "make" is run again an updated
| > pdf file is produced (if necessary) and evince loads the updated pdf.
| > Unfortunately, the evince window is behind other windows, and I have
| > to raise it manually. It would be great to do it automatically, by
| > adding some command to the Makefile at the "make" target. Is there any
| > way to do it at all? I have no idea how to start looking for something
| > like this...
| 
| You can do it using wmctrl:
| 
| http://tomas.styblo.name/wmctrl/
| 
| Roman Bogorodskiy

So can  "xwit"   and very old kde3 program  "wmiface"
However all three of these do not have any active development.

The new boy on the block (relatively speaking), with even more
functionality, with active development today, is    "xdotool"

This program containing a mixture of window modification (such as
"xwit" and "wmcrtl")  Event generators (such as "xte") which was
"xdotools" original purpose. It can also handle specific demonic event
handling such as "On window entry - print location, and set focus".
and has other unique features, like desktop change.

For example,  jump to desktop to the 'left' of the current one
(with wrap-around).  See if you can figure it out :-)
   xdotool set_desktop $( xdotool get_num_desktops get_desktop exec echo '1 - sa d la + r % p' | dc )

this is useful with "easystroke" mouse gestures

Note that while I use "xdotool" for many things I don't use them for all
things.   Similarly I find the "xwit" can do some things that "xwit"
can not.

In other words I find myself using all three programs, depending on the
task I am attempting to perform.



Example...

For a script based on "xwit" that will allow me to make a window
"bounce", "shake", "circle" etc., see...
   http://www.ict.griffith.edu.au/anthony/software/#jiggle_window

I have used this to make popup input windows bounce to attract the users
attention. Or an xterm window when some process I started in it has
finished.

ASIDE: I wrote a "xdotool" version of this, but xdotool has problems
translating "openbox" window positions  (location is offset by twice
the header and left border width!)  "xwit" was easier in this case.

"wmctrl" can not be used for this purpose

Comments or suggestions welcome!


  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 --------------------------------------------------------------------------
   ... money is like air and love, - unimportant if you've got
   enough of it, but desperately important if you haven't.
                             -- Terry Pratchett, "Science of Diskworld"
 --------------------------------------------------------------------------
   Anthony's Castle     http://www.ict.griffith.edu.au/anthony/


More information about the openbox mailing list