
WMIface
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
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
11 years ago
2.1:
- support for Qt4 versions older than 4.4.0
2.0:
- Qt4 version
11 years ago
2.1:
- support for Qt4 versions older than 4.4.0
2.0:
- Qt4 version
estellnb
11 years ago
Report
estellnb
12 years ago
> 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
13 years ago
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
13 years ago
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
estellnb
13 years ago
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
Seli
13 years ago
Report
-twosouls82-
14 years ago
'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-
14 years ago
How could this be?
Report
jezz
14 years ago
(I don't think "it work with any EWMH-compatible window manager" was the only argument, no?)
Report
Seli
14 years ago
[1] http://ktown.kde.org/~seli/kdewm/
Report