Re: grab focus

2008-12-05 Thread Erez D
The problem is now solved.

i use xlsclients -l to know the windowid
and xwit to focus.

thanks to you all.
erez.

On Tue, Dec 2, 2008 at 12:45 PM, Shachar Shemesh <[EMAIL PROTECTED]>wrote:

> Tzafrir Cohen wrote:
>
>> On Tue, Dec 02, 2008 at 12:18:24AM +0200, Erez D wrote:
>>
>>
>>> hi
>>>
>>>
>>> i'm looking for a command line util which lets me change x-focus.
>>> i am running two apps with *no window manager*, and i want to be able to
>>> switch focus between the two by command line
>>>
>>>
>>
>> aptitude install xdotool
>>
>> http://www.semicomplete.com/blog/projects/xdotool/
>>
>> http://www.semicomplete.com/blog/projects/xdotool/#id2255989
>>
>> It uses the XTEST extension. I figure that there are other similar tools.
>>
>>
>>
> XTEST simulates keyboard/mouse input. The fault with this logic is that,
> with no window manager, THERE IS NOT KEYBOARD OR MOUSE INPUT THAT WILL
> TRIGGER A FOCUS CHANGE. There is nothing to simulate.
>
> Shachar
>
>
>
> =
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
>
>


Re: grab focus

2008-12-02 Thread Shachar Shemesh

Tzafrir Cohen wrote:

On Tue, Dec 02, 2008 at 12:18:24AM +0200, Erez D wrote:
  

hi


i'm looking for a command line util which lets me change x-focus.
i am running two apps with *no window manager*, and i want to be able to
switch focus between the two by command line



aptitude install xdotool

http://www.semicomplete.com/blog/projects/xdotool/

http://www.semicomplete.com/blog/projects/xdotool/#id2255989

It uses the XTEST extension. I figure that there are other similar tools.

  
XTEST simulates keyboard/mouse input. The fault with this logic is that, 
with no window manager, THERE IS NOT KEYBOARD OR MOUSE INPUT THAT WILL 
TRIGGER A FOCUS CHANGE. There is nothing to simulate.


Shachar


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-02 Thread Tzafrir Cohen
On Tue, Dec 02, 2008 at 12:18:24AM +0200, Erez D wrote:
> hi
> 
> 
> i'm looking for a command line util which lets me change x-focus.
> i am running two apps with no window manager, and i want to be able to
> switch focus between the two by command line

aptitude install xdotool

http://www.semicomplete.com/blog/projects/xdotool/

http://www.semicomplete.com/blog/projects/xdotool/#id2255989

It uses the XTEST extension. I figure that there are other similar tools.

-- 
Tzafrir Cohen | [EMAIL PROTECTED] | VIM is
http://tzafrir.org.il || a Mutt's
[EMAIL PROTECTED] ||  best
ICQ# 16849754 || friend

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Roll your own Window Manager (was: Re: Re: grab focus)

2008-12-02 Thread Yedidyah Bar-David
On Tue, Dec 02, 2008 at 08:43:39AM +0200, Omer Zak wrote:
> I googled for the above and came up with:
> 
> http://en.wikipedia.org/wiki/Xmonad - a tiling window manager for
> X-Window, written in Haskell.  Makes it possible to manage windows
> without using a mouse.
> 
> http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/01
> http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/17
> Those articles describe the design of the above (written in Haskell, of
> all languages!).  Version 0.1 is 490 lines of code, so does it (with
> Haskell libraries) have sufficiently small memory footprint for use in
> Erez D's system?

A quick search in debian's archive finds also:

tinywm - tiny window manager
Seems to actually include three versions, a C version (58 lines),
annotated C version (179 lines), and a python version (40 lines). Seems
useful mainly as a demonstration.

nawm - Non-windowmanager with windowmanager functionality
Somewhat similar to xwit.
-- 
Didi


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-02 Thread Shachar Shemesh

Omer Zak wrote:


At impulse, I downloaded and compiled it.  The 'Usage:' path works for
me.

>From usability point of view, the documentation (and maybe the
application itself)
Patches welcome. It was a focused effort, oh, maybe half an hour long. 
Most of that time was spent searching for the name of the AC_PATH_XTRA 
configure macro.

 is missing a way to find out what window handles are
there now.  Remember - do not ask the window manager for this
information!
  

Run xwininfo and click on the window.

How about having xfocus display a list of the handles of all open
windows (along with some identifying information such as window title or
controlling process ID - for the user to match up with more information
using ps's output) when provided with no window handle argument?
  

Like Didi already said, xwininfo can do that too.

When done, xfocus will be cool little application!
  
I'm not sure it's worth the trouble of packaging it, but if the need is 
there I have no objection.


Shachar

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-01 Thread Yedidyah Bar-David
On Tue, Dec 02, 2008 at 08:56:55AM +0200, Omer Zak wrote:
> > I quickly wrote something.
> > 
> > http://www.lingnu.com/files/xfocus-0.01.tar.gz
> > 
> > Let me know if this works for you.
> 
> At impulse, I downloaded and compiled it.  The 'Usage:' path works for
> me.
> 
> >From usability point of view, the documentation (and maybe the
> application itself) is missing a way to find out what window handles are
> there now.  Remember - do not ask the window manager for this
> information!
> 
> How about having xfocus display a list of the handles of all open
> windows (along with some identifying information such as window title or
> controlling process ID - for the user to match up with more information
> using ps's output) when provided with no window handle argument?

xlsclients -l
or
xwininfo -all -root
will give you relevant data.

> 
> When done, xfocus will be cool little application!

Indeed, but is it needed? xwit exists (for 17 or so years now), together
with many other small forgotten utilities from the 90's, many of which
can be found in your favourite x.org mirror under contrib/utilities, and
in the archive of your favourite linux distro (especially if that's
Debian :-) ).
-- 
Didi


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-01 Thread Omer Zak
On Tue, 2008-12-02 at 08:27 +0200, Shachar Shemesh wrote:
> Erez D wrote:
> > hi
> >
> >
> > i'm looking for a command line util which lets me change x-focus.
> > i am running two apps with no window manager, and i want to be able to 
> > switch focus between the two by command line
> >
> >
> >
> > any idea ?
> >
> >
> > thanks,
> > erez.
> >
> I quickly wrote something.
> 
> http://www.lingnu.com/files/xfocus-0.01.tar.gz
> 
> Let me know if this works for you.

At impulse, I downloaded and compiled it.  The 'Usage:' path works for
me.

>From usability point of view, the documentation (and maybe the
application itself) is missing a way to find out what window handles are
there now.  Remember - do not ask the window manager for this
information!

How about having xfocus display a list of the handles of all open
windows (along with some identifying information such as window title or
controlling process ID - for the user to match up with more information
using ps's output) when provided with no window handle argument?

When done, xfocus will be cool little application!

--- Omer

-- 
You haven't made an impact on the world before you caused a Debian
release to be named after Snufkin.
My own blog is at http://www.zak.co.il/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-01 Thread Yedidyah Bar-David
On Tue, Dec 02, 2008 at 12:18:24AM +0200, Erez D wrote:
> hi
> 
> 
> i'm looking for a command line util which lets me change x-focus.
> i am running two apps with no window manager, and i want to be able to
> switch focus between the two by command line

xwit

Not sure it will work well without a window manager - as others said,
some things in X are the window-manager's role. Do consider using one
which is either simple or can be configured to be simple enough for your
needs. I used for a very long time (until 1-2 years ago) fvwm, which has
(among many other features) a module called FvwmCommand, which can be
used to send to it commands at runtime. There might be other WMs that
have similar features, I don't know.
-- 
Didi


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Roll your own Window Manager (was: Re: Re: grab focus)

2008-12-01 Thread Omer Zak
I googled for the above and came up with:

http://en.wikipedia.org/wiki/Xmonad - a tiling window manager for
X-Window, written in Haskell.  Makes it possible to manage windows
without using a mouse.

http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/01
http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/17
Those articles describe the design of the above (written in Haskell, of
all languages!).  Version 0.1 is 490 lines of code, so does it (with
Haskell libraries) have sufficiently small memory footprint for use in
Erez D's system?

--- Omer


On Tue, 2008-12-02 at 07:43 +0200, Shachar Shemesh wrote:
> Omer Zak wrote:
> >
> > OK, I'll bite even though I know of no such utility.
> > I assume that you are using X-Window server, but without any window
> > manager.
> > 1. Find or develop an utility for simulating mouse events and delivering
> > them to X-Window.  Then use mouse events to change focus.
> > 2. Find or write a very simple window manager, which knows to switch
> > focus by commands via a FIFO, to which your command line utility writes.
> > 3. Is it possible to write a simple application which calls XSendEvent()
> > with suitable events?
> >
> >   
> 1 and 3 will simply not work. Without a window manager there are just 
> two options. The X default is that the focus follows the mouse. Changing 
> this default will lead to the focus hanging on a certain window until 
> changed via the API. There is no mouse or keyboard sequence to tell X to 
> switch focus to another window. This is 100% the window manager's task.
> 
> As for 2, it will work, but it is probably a gross overkill.
> 
> How do you intend to identify the window that is to receive focus? Do 
> you have its Window ID? Do you want to do it by screen coordinates?
> 
> If the former, RTFM the XSetInputFocus command. Aside from the overheads 
> (opening the X session), this is a one function command, and should be 
> fairly straight forward. Be warned, however, that it may very well not 
> work if a window manager happens to be running, as a window manager has 
> total veto power over any command affecting, well, windows (size, 
> display/hide, move etc.), so if you are trying to test it with KDE or 
> Gnome running, and it does nothing, don't despair. Try it again with no 
> window manager.
> 
> Shachar
-- 
"Kosher" Cellphones (cellphones with blocked SMS, video and Internet)
are menace to the deaf.  They must be outlawed!
(See also: 
http://www.zak.co.il/tddpirate/2006/04/21/the-grave-danger-to-the-deaf-from-kosher-cellphones/)
My own blog is at http://www.zak.co.il/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-01 Thread Shachar Shemesh

Erez D wrote:

hi


i'm looking for a command line util which lets me change x-focus.
i am running two apps with no window manager, and i want to be able to 
switch focus between the two by command line




any idea ?


thanks,
erez.


I quickly wrote something.

http://www.lingnu.com/files/xfocus-0.01.tar.gz

Let me know if this works for you.

Shachar

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-01 Thread Shachar Shemesh

Omer Zak wrote:


OK, I'll bite even though I know of no such utility.
I assume that you are using X-Window server, but without any window
manager.
1. Find or develop an utility for simulating mouse events and delivering
them to X-Window.  Then use mouse events to change focus.
2. Find or write a very simple window manager, which knows to switch
focus by commands via a FIFO, to which your command line utility writes.
3. Is it possible to write a simple application which calls XSendEvent()
with suitable events?

  
1 and 3 will simply not work. Without a window manager there are just 
two options. The X default is that the focus follows the mouse. Changing 
this default will lead to the focus hanging on a certain window until 
changed via the API. There is no mouse or keyboard sequence to tell X to 
switch focus to another window. This is 100% the window manager's task.


As for 2, it will work, but it is probably a gross overkill.

How do you intend to identify the window that is to receive focus? Do 
you have its Window ID? Do you want to do it by screen coordinates?


If the former, RTFM the XSetInputFocus command. Aside from the overheads 
(opening the X session), this is a one function command, and should be 
fairly straight forward. Be warned, however, that it may very well not 
work if a window manager happens to be running, as a window manager has 
total veto power over any command affecting, well, windows (size, 
display/hide, move etc.), so if you are trying to test it with KDE or 
Gnome running, and it does nothing, don't despair. Try it again with no 
window manager.


Shachar

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: grab focus

2008-12-01 Thread Omer Zak
On Tue, 2008-12-02 at 00:18 +0200, Erez D wrote:
> hi
> 
> 
> i'm looking for a command line util which lets me change x-focus.
> i am running two apps with no window manager, and i want to be able to
> switch focus between the two by command line
> 
> 
> 
> any idea ?

OK, I'll bite even though I know of no such utility.
I assume that you are using X-Window server, but without any window
manager.
1. Find or develop an utility for simulating mouse events and delivering
them to X-Window.  Then use mouse events to change focus.
2. Find or write a very simple window manager, which knows to switch
focus by commands via a FIFO, to which your command line utility writes.
3. Is it possible to write a simple application which calls XSendEvent()
with suitable events?



-- 
"Kosher" Cellphones (cellphones with blocked SMS, video and Internet)
are menace to the deaf.  They must be outlawed!
(See also: 
http://www.zak.co.il/tddpirate/2006/04/21/the-grave-danger-to-the-deaf-from-kosher-cellphones/)
My own blog is at http://www.zak.co.il/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]