[ltp] [OT]: KDE hack: script to list and control windows?

Martin Steigerwald linux-thinkpad@linux-thinkpad.org
Fri, 24 Feb 2006 19:52:37 +0100


Am Freitag 24 Februar 2006 02:29 schrieb Matt Graham:

> > 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).

Regards,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7