was https://sites.google.com/site/tstyblo/wmctrl
A command line tool to interact with an EWMH/NetWM compatible X Window Manager. Get information, resize, move, etc.
A good tool for what it does.
-
Abandoned - Not updated
- As of 2020-12-30 Last updated 2005-10-10 (1.08)
--
- 2010-04-13 - 1.07 on Unity Linux 64bit-beta2
- 2010-02-03 - 1.07 on Unity Linux 64bit-beta2
-
2007-07-21 - 1.07 on (distribution not recorded)
Description ∞
The wmctrl program is a UNIX/Linux command line tool to interact with an EWMH/NetWM compatible X Window Manager.
The tool provides command line access to almost all the features defined in the EWMH specification. It can be used, for example, to obtain information about the window manager, to get a detailed list of desktops and managed windows, to switch and resize desktops, to make windows full-screen, always-above or sticky, and to activate, close, move, resize, maximize and minimize them.
The command line access to these window management functions makes it easy to automate and execute them from any application that is able to run a command in response to an event.
Tips and Tricks ∞
Based on PID, find and work with the long name ∞
Is there a way to create a shortkey to take the active window to the next desktop (as in Sawfish)? ∞
- Answer 1: The best solution would be to use a keygrabber (such as bbkeys) and make use if it's specific features. The issue has been addressed in the bbkeys feature request #740764 and proposed patches #1189443 and #1189457. [ 1 ]
-
Answer 2: Here's a workaround, which uses the
wmctrl
tool and a shell script to achieve the desired result. It is rather strange and slow, and besides you would still need to bind the script to a key, and you end up with the same answer: this kind of support is better suited for being built-in inside the keygrabber. But it's an interesting script so here it goes, a script that moves the currently active window to the next desktop:
script
#!/bin/bash #email author at webograph eml cc let active_desktop=`wmctrl -d |grep "*" | sed "s/\s\+.*$//"` case $1 in right) let active_desktop+=1 if [ "$active_desktop" -g 3 ] # in case you have more or less than 4 desktops, change accordingly then let active_desktop=0 fi ;; left) let active_desktop-=1 if [ "$active_desktop" -l 0 ] then let active_desktop=3 # same as above fi ;; esac; wmctrl -r :ACTIVE: -t $active_desktop wmctrl -s $active_desktop
Hacks ∞
Links ∞
2010-04-13 - 1.07 ∞
During make
, it gives:
main.c:36:29: error: X11/Xmu/WinUtil.h: No such file or directory
then:
smart install lib64xmu-devel
2010-02-03 - 1.07 ∞
While ./configure
works well, make
gives an error:
output
if gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"wmctrl\" -DVERSION=\"1.07\" -I. -I. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -Wall -g -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" \ -c -o main.o `test -f 'main.c' || echo './'`main.c; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; \ else rm -f ".deps/main.Tpo"; exit 1; \ fi main.c:36:29: error: X11/Xmu/WinUtil.h: No such file or directory main.c: In function ‘window_set_title’: main.c:651: warning: pointer targets in passing argument 7 of ‘XChangeProperty’ differ in signedness /usr/include/X11/Xlib.h:2075: note: expected ‘const unsigned char *’ but argument is of type ‘gchar *’ main.c:658: warning: pointer targets in passing argument 7 of ‘XChangeProperty’ differ in signedness /usr/include/X11/Xlib.h:2075: note: expected ‘const unsigned char *’ but argument is of type ‘gchar *’ main.c:665: warning: pointer targets in passing argument 7 of ‘XChangeProperty’ differ in signedness /usr/include/X11/Xlib.h:2075: note: expected ‘const unsigned char *’ but argument is of type ‘gchar *’ main.c:672: warning: pointer targets in passing argument 7 of ‘XChangeProperty’ differ in signedness /usr/include/X11/Xlib.h:2075: note: expected ‘const unsigned char *’ but argument is of type ‘gchar *’ main.c: In function ‘Select_Window’: main.c:1506: warning: implicit declaration of function ‘XmuClientWindow’ make: *** [main.o] Error 1
2007-07-21 - 1.07 ∞
It took me a long time, but I did end up coming back to figure wmctrl out. See my wmctrl user documentation[doesn't exist].
Issues:
- It's not possible to minimize a window!
-
I also have no idea how to learn the status of a window.
Similar tools / alternatives ∞
- Devil's Pie
- xdpyinfo, xprop, xlsclients, xlsatoms and xwininfo.
-
autoproperties support from the window manager itself.
- KDE has a GUI tool.
- Openbox's
rc.xml
has a way to specify application window properties. I don't think there's a GUI for it yet. - PekWM has autoproperties
Please contact me if you find any other interesting tools.
Last updated 2024-05-14 at 03:08:59
Footnotes
- FIXME: As of the time of this writing, the new functionality has been accepted into bbkeys and will be part of version 1.0.0, whenever that comes out. In the meantime, you can check out a current copy from CVS (was http://sourceforge.net/cvs/?group_id=33459). [ ↩ ]
style update
ported review notes
ported tips and tricks
It looks like this project is still abandoned; flagging it as such.
moved a script into git to workaround a blogtext bug