[openbox] Go to a program if it's already running

Anthony Thyssen A.Thyssen at griffith.edu.au
Mon Jul 22 22:54:21 EDT 2013


Management of windows is actually its primary task. The event part is a
bonus.

There are some things I would do with the older tools, and some I would
use one of those three over another.



XDoTool is also listed not just as a "Event Generator" (like keyboard
macros, or mouse moving/clicking), but also as an something that can do
"Event Handling". That is things like 'Do this if mouse hits edge'.

For example, there is a script included that will... If mouse hit the
top of screen, do a animated 'slide out' of a command line input
window.  If mouse leaves that window, 'slide it in again'.


The Three App lists are...
   Window and Window Manager Control...
   Event Handling....
   Event Generators...
in
  http://www.ict.griffith.edu.au/anthony/info/X/progs.summary


Note I don't avocate that XDoTool is the best tool for anything, but it is
another useful 'option' for DIY X window shell scripts.

For an example of something I wrote.. See 'Jiggle Window'
  http://www.ict.griffith.edu.au/anthony/software/#jiggle_window

or one I modified from someone else...
  http://www.ict.griffith.edu.au/anthony/software/#edit_textbuf
This grabs the text buffer under the mouse, into a full editor, then
puts the text back again afterwards!




  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 --------------------------------------------------------------------------
   Encryption... is a powerful defensive weapon for free people.
   It offers a technical guarantee of privacy, regardless of who is
   running the government... It's hard to think of a more powerful,
   less dangerous tool for liberty.            --  Esther Dyson
 --------------------------------------------------------------------------
   Anthony's Castle     http://www.ict.griffith.edu.au/anthony/



On Fri, 19 Jul 2013 08:43:09 +0200
Wujek Srujek <wujek.srujek at gmail.com> wrote:
| I didn't know xdotool was to manage windows, I though it was only to
| generate events (like do a mouse click in the top left corner of the
| screen or moving a mouse somewhere). Thanks for the tip.
| 
| On 7/19/13, Anthony Thyssen <A.Thyssen at griffith.edu.au> wrote:
| > On Thu, 18 Jul 2013 20:44:12 +0200
| > Antoine <antoine.vigouroux at numericable.fr> wrote:
| > | On 18/07/2013 19:43, Wujek Srujek wrote:
| > | > !/usr/bin/bash
| > | >
| > | > if [ "$#" -gt 1 ]; then
| > | >     echo "Has arguments, starting..."
| > | >     "$@" &
| > | >     exit
| > | > fi
| > | >
| > | > CMD="$1"
| > | > app="$(wmctrl -lx | grep "$CMD" | head -n 1)"
| > | > if [ -z "$app" ]; then
| > | >     echo "App not found, starting..."
| > | >     "$CMD" &
| > | > else
| > | >     id="$(echo $app | cut -f 1 -d ' ')"
| > | >     echo "Refocusing app..."
| > | >     wmctrl -i -R "$id"
| > | > fi
| > | >
| > | Thanks a lot. I had never heard of wmctrl, that's awesome.
| >
| >
| > There are a number of such programs, many like wmctrl are old and
| > no longer being developed.  The one that is in active development is
| > xdotool.
| >
| > Here is a list...
| >   xwit          Modify Size Position, Iconification of windows.
| >                 This fails with some applications.
| >   wmctrl        Modify Windows (and desktops) with wm like controls
| >                 Each provide quite different sets of posible actions
| >   wmiface       A old KDE3-based window controller
| >   xdotool       Window modifaction but also X event generation
| >                 (see Event Generators below)
| >
| >
| > This comes from a personal list of X windows software (started a very
| > long time ago)
| > http://www.ict.griffith.edu.au/anthony/info/X/progs.summary
| >
| >



More information about the openbox mailing list