[Gambas-user] New to Gambas - coding question how to find the active window on an Ubuntu 7.10 desktop

Khos kim.hoskin at ...1073...
Fri Jan 25 21:16:16 CET 2008


Hi there, thanks I see the link, download it but cannot open it..
activewindow-0.0.6.tar.gz is not being recognised?

In the meantime I have found a command that might just do what I need:
sleep 5; xprop -id `xprop -root |nawk '/_NET_ACTIVE_WINDOW/ {print $5;
exit;}'` |nawk -F = '/WM_CLASS/ {N=split($2, A, ", "); gsub(/\"/,"",A[2]);
print A[2]; exit;}'

I can use this with the shell command.. and I will need to change WM_CLASS
to WM_ICON_NAME and  change the splitting of the result.. what do you think?
or can you send me your file in another way?

Thank you so much!
Kim





Stefano Palmeri wrote:
> 
> Alle 18:51, venerdì 25 gennaio 2008, Khos ha scritto:
>> Hi,
>>
>> Where could I find the project, is it on
>> http://freshmeat.net/projects/wmctrl/ ?
>> Thanks
>> Kim
> 
> It's the attached file. It's a Gambas project.
> 
> Stefano
> 
> 
> 
> 
>>
>> Stefano Palmeri wrote:
>> > Alle 20:30, giovedì 24 gennaio 2008, Khos ha scritto:
>> >> Thanks Stefano,
>> >> Appreciate your input, I wonder if there is a way to include this
>> wmctrl
>> >> util when I compile my Gambas application? any ideas?
>> >>
>> >> Bye for now,
>> >> Kim
>> >
>> > Look for the project I sent today. You don't need anymore wmctrl.
>> >
>> > Stefano
>> >
>> >> Stefano Palmeri wrote:
>> >> > Alle 19:43, mercoledì 23 gennaio 2008, Khos ha scritto:
>> >> >> Hi again,
>> >> >> I am still struggling to do this, I have started searching for
>> >> >> shell/terminal commands I could try use because  e.g. using shell
>> >> >> xwininfo
>> >> >> will allow me to hover the mouse over a window, then I click and it
>> >>
>> >> will
>> >>
>> >> >> give some info of that window I clicked on...but how can I do this
>> >> >> without
>> >> >> having to click on the window? I just want to be able to hover over
>> >>
>> >> any
>> >>
>> >> >> window and it should give me the windows info (size, is it he
>> active
>> >>
>> >> win
>> >>
>> >> >> etc etc). Any ideas? desktop,find won't so this I think.. could you
>> >>
>> >> lok
>> >>
>> >> >> into this for me and provide some guidance?
>> >> >>
>> >> >> Thanks
>> >> >> Kim
>> >> >
>> >> > Hi, Kim.
>> >> >
>> >> > All you need is this little utility:
>> >> >
>> >> > http://freshmeat.net/projects/wmctrl/
>> >> >
>> >> > after compiling and installing, simply open a lot of windows
>> >> > and the run
>> >> >
>> >> > wmctrl -l
>> >> >
>> >> > it will list all windows on your desktop. The little program has a
>> lot
>> >> > of options that will help you. See man page or "wmctrl --help"
>> >> >
>> >> > Regards,
>> >> >
>> >> > Stefano
>> >> >
>> >> >> Benoit Minisini wrote:
>> >> >> > On dimanche 20 janvier 2008, Khos wrote:
>> >> >> >> Thanks Jose and Oh master of Gambas :)
>> >> >> >>
>> >> >> >> I will have a look at Jose's info but Benoit.. I have tried to
>> use
>> >> >> >> Desktop.Find() but the documentation was not so understandable
>> for
>> >> >> >> me. It would seem like a much simpler way with this. Does this
>> >> >> >> function
>> >> >>
>> >> >> get
>> >> >>
>> >> >> >> all the windows titles and put it into an array? if so how would
>> >>
>> >> you
>> >>
>> >> >> >> know which
>> >> >> >> one is the active window? there are no sample codes on how to
>> use
>> >> >> >> this function, unless you could point to some, I would
>> appreciate
>> >> >> >> your efforts very much :)
>> >> >> >>
>> >> >> >> Many thanks for the help so far folks!
>> >> >> >> Kind regards
>> >> >> >> Kim
>> >> >> >
>> >> >> > I don't know if it is possible to know the active window with X
>> >> >> > Window. Maybe
>> >> >> > the desktop manager stores a property about it in the root
>> window?
>> >> >> >
>> >> >> > --
>> >> >> > Benoit Minisini
>> >>
>> >>
>> ------------------------------------------------------------------------
>> >>
>> >> >>-
>> >> >>
>> >> >> > This SF.net email is sponsored by: Microsoft
>> >> >> > Defy all challenges. Microsoft(R) Visual Studio 2008.
>> >> >> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> >> >> > _______________________________________________
>> >> >> > Gambas-user mailing list
>> >> >> > Gambas-user at lists.sourceforge.net
>> >> >> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >>
>> >>
>> ------------------------------------------------------------------------
>> >>-
>> >>
>> >> > This SF.net email is sponsored by: Microsoft
>> >> > Defy all challenges. Microsoft(R) Visual Studio 2008.
>> >> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> >> > _______________________________________________
>> >> > Gambas-user mailing list
>> >> > Gambas-user at lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >
>> >
>> -------------------------------------------------------------------------
>> > This SF.net email is sponsored by: Microsoft
>> > Defy all challenges. Microsoft(R) Visual Studio 2008.
>> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> > _______________________________________________
>> > Gambas-user mailing list
>> > Gambas-user at lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
>  
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 

-- 
View this message in context: http://www.nabble.com/New-to-Gambas---coding-question-how-to-find-the-active-window-on-an-Ubuntu-7.10-desktop-tp14931902p15095134.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list