Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 May 2010 18:10:30 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Chris Telting <christopher-ml@telting.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: window/app aware bindkey/input control application?
Message-ID:  <20100502181030.afaa291b.freebsd@edvax.de>
In-Reply-To: <4BDD9DCD.50900@telting.org>
References:  <4BDD9DCD.50900@telting.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 02 May 2010 08:44:13 -0700, Chris Telting <christopher-ml@telting.org> wrote:
> I'm wondering if there exists an app or set of apps that are 
> window/application aware for use in conjunction with multimedia keys, 
> remote control, input control surfaces.
> 
> Simple example: detect all mutimedia applications, if only one or none 
> is started then issue command1 otherwise see if any of the above 
> applications has the focus and issue it's appropriate command else play 
> an error sound.
> 
> I guess you could say I'm interested in scripting keyboard input in 
> conjunction with the window manager.

Hmmm........

I'm sure you can do this with WindowMaker. First, create a
menu entry refering to a shell script, then assign the desired
key combination or special (multimedia) key to it. In the
script, use ps to see if a specific application is already
running. The "has focus" attribute can be obtained via a
call to the xprop command (and parsing its output). According
to the result, a specific command can then be executed.

(I'm using a similar setup to utilize the special keys of
my Sun keyboard to control multimedia functions, program
startups and window manager functionalities.)

I'm not sure if such a solution already exist in "ready form",
but it shouldn't be hard to implement it. Additionally, I'm
not sure if this can be done with all kinds of window managers
or full desktop environments.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100502181030.afaa291b.freebsd>