WMIface 2.0

Lubos Lunak l.lunak at kde.org
Wed Jul 8 13:29:19 CEST 2009


Name: WMIface
Version: 2.0
Type: KDE Other Utility
Depend: Qt 4.x
License: GPL
Homepage: http://ktown.kde.org/~seli/wmiface/
More Info:
http://www.kde-apps.org/content/show.php?content=40425

Description:
 This command line tool allows user scripting of
the running window manager (usually KWin, but a
separate module allows scripting any
EWMH-compatible window manager that's running in
KDE).

It can be also used as a replacement for the
wmctrl tool, which no longer seem to be
maintained. It also provides more features than
just directly mapping to the window manager
specifications and as such it should be more easy
and convenient to use.

The only dependency of this tool is the Qt4 QtCore
library and the X11 libraries.

Users of the old KDE3 version, please see the
(very simple) porting instructions in the README
file.

IMPORTANT #1: It is meant ONLY for user scripting.
Applications should use classes from libkdeui
(NET*, KWindowSystem, KWindowInfo). This CLI
interface assumes it is used by a user and using
it from applications may lead to various problems.
 
IMPORTANT #2: There are often better ways of doing
things than scripting using this interface,
especially if they are simple. For example if you
just want to affect geometry of a specific window,
it is usually simpler to use KWin's
window-specific settings for that window
(Alt+F3/Advanced). On the other hand, this CLI
interface is specially designed for user window
management and as such it's sometimes better than
using D-Bus for talking to application. E.g.
something like "qdbus org.kde.konqueror-4770
/konqueror/MainWindow_1 raise" will make the
application try to raise itself, which may be
blocked by the window manager (KWin blocks
inactive windows that try to steal the focus or
get attention in other ways), however "wmiface
raiseWindow 60817415" will raise the window,
because now the window manager is told directly.
 
See the README file for more details.

Three examples: 

Launch Konqueror showing http://kde.org, close it
after 10 seconds

konqueror http://dot.kde.org --name dotkonqueror &
sleep 10
window=$(wmiface findNormalWindows ""
"dotkonqueror Konqueror" "" "" 0 false)
wmiface closeWindow $window

Cycle virtual desktops slowly

while true; do
    sleep 10
    desktop=$(wmiface currentDesktop)
    total=$(wmiface numberOfDesktops)
    if test $desktop = $total; then
        wmiface setCurrentDesktop 1
    else
        wmiface setCurrentDesktop $(( desktop + 1
))
    fi
done

Minimize all KWrite windows

wmiface findNormalWindows "" " Kwrite" "" "" 0
false | \
    while read ln; do
        wmiface minimize $ln
    done


Changelog:
 Qt4 version





JOB RECOMMENDATION:
------
Junior Software Engineer in Stuttgart (w/m) -
softSCIENCE GmbH - vollzeit
 http://www.KDE-Apps.org/jobs/?id=61
------
Praktikant m/w Programmierung/Marketing/IT -
openDesktop.org - trainee
 http://www.KDE-Apps.org/jobs/?id=109

more jobs: http://www.KDE-Apps.org/jobs/




More information about the Kde-announce-apps mailing list