[ltp] [OT]: KDE hack: script to list and control windows?
Richard Neill
linux-thinkpad@linux-thinkpad.org
Sat, 25 Feb 2006 00:45:04 +0000
>>>This would either be done by X or perhaps DCOP.
>>
>>DCOP is a neat idea, but the functions you need may not be there for
>>all programs.
>
>
> Hello Matt,
>
> well they are there ;-):
>
> dcop konsole-4785 konsole-mainwindow#1 maximize
> dcop konsole-4785 konsole-mainwindow#1 minimize
>
> You need to change konsole-4785 to the name of an DCOP capable application
> running on your system. With "dcop" you get a list of applications that
> have DCOP... every application with an window open should have at least a
> "*mainwindow#1" that you can deal with. You will see by trying "dcop
> appname".
>
> You get a long list of possible functions:
>
> martin@deepdance:~ -> dcop konsole-4785 konsole-mainwindow#1
> [... several pages of functions ...]
> void grabWindowToClipBoard()
> void hide()
> void maximize()
> void minimize()
> void resize(int newWidth,int newHeight)
> void move(int newX,int newY)
> void setGeometry(int newX,int newY,int newWidth,int newHeight)
> void raise()
> void lower()
> void restore()
> void show()
>
> Of course that only works with KDE, possibly also other Qt apps (did not
> try).
Thanks Martin. That's a very helpful post, but it doesn't quite answer
the particular problem I'm trying to solve. The problem is that I need
something which can control all the windows, even when applications
(openoffice,mozilla,gnumeric,etc) are not QT ones.
It seems to me that these functions ought to be part of the
taskbar/kicker/panel/kwin, where they would be most useful and general.
Eg, to minimise a konsole window, what I am thinking isn't "Dear
konsole, please would you minimise for me" but "Dear kicker, would you
be so good as to minimise that window I just clicked on". I'm trying to
talk to the window manager, not the application.
wmctrl is the way to go, I think!
Best wishes,
Richard