WMIface
Utilities
Score 67%
Description:

This command line tool allows user scripting of the running window manager (any EWMH-compatible window manager, including KDE's KWin, GNOME's Metacity, Compiz and others).

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
Last changelog:

11 years ago

2.1:
- support for Qt4 versions older than 4.4.0
2.0:
- Qt4 version

estellnb

8 years ago

What about wmiface on KDE4?

Report

estellnb

8 years ago

wmiface does not seem to work on suse11.1
> dcop kded wmiface
object 'wmiface' in application 'kded' not accessible
> kwin --version
Qt: 3.3.8b
KDE: 3.5.10 "release 21.11"
KWin: 3.0
will there be any fix for current versions of kde3

Report

Emeric

10 years ago

thanks!
I made a quick ebuild for it, too :

# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:$

inherit kde

DESCRIPTION="Window Manager DCOP interface for Kwin or any EWMH-compatible window manager that's running in kde"
HOMEPAGE="http://ktown.kde.org/~seli/wmiface/"
LICENSE="GPL-2"
SLOT="0"
IUSE=""

SRC_URI="http://ktown.kde.org/~seli/wmiface/wmiface-0.1.tar.bz2"
KEYWORDS="~x86"

need-kde 3.5

Report

estellnb

10 years ago

Is there any further and comprehensive documentation about WMIface?
What do the 6 parameters of the findNormalWindows method stand for?
Are there any other functions than those mentioned in the few specific examples?
Why does kdcop not show these methods? Is there a good source about dcop scripting in general?

Report

C

Seli

10 years ago

There is a complete documentation in the README shipped with the tarball.

Report

estellnb

10 years ago

dcop scripting(bash) & further links (Konsole DCOP Scheme Automation Tool):
for KDE apps only; activate & maximize(fullscreen) application main window; konqueror-openURL
http://de.kde-apps.org/content/show.php/DCOP+Script?content=52463&PHPSESSID=4f2416ea14cc1a505e1dae7856f80e27

wmiface dcop scripting with bash (wapp):
application preloading; summon appwin to current working area; uses kwin/wmiface only - for all apps (Firefox, Ding, ...)
http://de.kde-apps.org/content/show.php/wapp?content=64961&PHPSESSID=4f2416ea14cc1a505e1dae7856f80e27

Report

-twosouls82-

11 years ago

This is just a great achievement/improvement if you ask me. I once tried xfwm4 (Xfce's Window Manager) and I loved the decorations/themes for it so much better than those of KWin.
'Though KDE gave me the opportunity to change the window manager (using the KDEWM variable in the ~/.bashrc); KPager didn't allow me to switch my desktops any more, the WindowList applet didn't function anymore etc.

Now it is just a question of writing a few bash scripts to do those things.

Using xfwm4 again (^-^)

Thank you very much/Hartelijk bedankt,
twosouls82

Report

-twosouls82-

11 years ago

:s before I got to write the scripts KPager worked already.

How could this be?

Report

jezz

11 years ago

Why not include this interface in kwin (See #34882)?


(I don't think "it work with any EWMH-compatible window manager" was the only argument, no?)

Report

C

Seli

11 years ago

It was, basically. Yeah, I know I said in the bugreport it'd mean just adding DCOP calls to KWin :-/ , but this way it works even if one runs other WM[1] with KDE (e.g. Metacity), and in fact, as long as kdeinit is running, it can work even outside of KDE (it's be rather funny to see some GNOME people scripting Metacity this way to get around some lacking Metacity features ;) ).

[1] http://ktown.kde.org/~seli/kdewm/

Report

11 years ago

2.1:
- support for Qt4 versions older than 4.4.0
2.0:
- Qt4 version

product-maker 7 20

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
2.1
updated Oct 15 2009
added Jun 06 2006
downloads today
0
page views today 0