[openbox] Go to a program if it's already running
Anthony Thyssen
A.Thyssen at griffith.edu.au
Thu Jul 18 19:03:11 EDT 2013
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
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
--------------------------------------------------------------------------
Warning - the varmits in these woods are NOT tame.
Travellers are warning to stay on the road,
as their remains will not be returned to their kin. -- The Lerdki
Robert Heinlein's, "Glory Road"
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/
More information about the openbox
mailing list