wmctrl
a shell tool to automate some windowing tasks
it is not dependend ona specific WM such as gnome or KDE
(? it might have different behaviour depeding on which WM is used - unconfirmed )
Wmctrl is intended for use with Window managers which meet the EWMH/NetWM specifications, it issues EWMH requests.
sudo apt-get install wmctrl (available std in LXM)
documentation
- archwiki, zoals altijd
- https://linux.die.net/man/1/wmctrl
- LX windowing automation
- Hack and automate your Desktop with wmctrl : https://www.linuxjournal.com/magazine/hack-and-automate-your-desktop-wmctrl
options
https://blog.spiralofhope.com/1042/wmctrl-user-documentation-examples.html
< WIN> : window name
-r on which window to act , defined by < WIN>
-t tagrget workspace (zero based 0 = 1 etc )
-i Interpret < WIN> as a numerical window ID.
-g change geometry van een window
-p show program PID as well
-b add or remove 1 or 2 property ( prop1 and _prop2)
property change is achived by a EWMH _NET_WM_STATE request.
supported property : modal, sticky, maximized_vert, maximized_horz, shaded, skip_taskbar, skip_pager, hidden, fullscreen, above and below.
shaded : enkel de title is nog zichtbaar
volgende 2 props zwerden blijkbaar speciaal voor widgets ontwikkeld :
skip taskbar : niet op taakbaar , niet in alt-tab
skip_pager ? (the window should not be included on pagers)
( ? pagers are https://fedoramagazine.org/5-cool-terminal-pagers-in-fedora/ text pagers such as : more , less etc )
pspg pager for tabular data sucha as csv or sql : https://github.com/okbob/pspg
The -i option needs a window id, which is what you get if you run
xdotool getactivewindow
=> 20971543.
wmctrl -i -r "$(xdotool getactivewindow)"
wmctrl -m : which window manger is actully used
Name: Mutter (Muffin)
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A
Muffin is a fork of Mutter (OpenGL variant for Gnome) , used/designed for Cinamon
cat /etc/X11/default-display-manager
=> /usr/sbin/lightdm
wmctrl -r :ACTIVE: -e 0,0,-1,-1,-1
wmctrl -r :ACTIVE: -e 0,1440,-1,-1,-1
NOTE: Replace 1440 with whatever the horizontal screen resolution is of the left monitor.
-r < WIN> -e < G>,< X>,< Y>,< W>,< H> resize/move the window using gravity, x, y, width, height
(gravity of 0 uses window’s default gravity and values of -1 specify window’s properties for other values.)
The first command above will move the active window to the left most edge of the viewing space.
The second command will move the active window to the 1440 pixels from the left most edge. In my case, the resolution of my left monitor is 1440x900.
Change 1440 to reflect the horizontal resolution of your setup.
-e : gravity pos X pos Y , length X in pxls height in pxl
wmctrl -r zotero -e 0,0,-1,-1,-1 && wmctrl -r zotero -e 0,1920,-1,-1,-1
nope
wmctrl -r “zotero” -e 1,0,0,1920,1080
nope
wmctrl -r “zotero” -e 0,0,0,1920,1080
werkt , echter de titelbalk is niet meer klikbaar
==wmctrl -r “zotero” -e 0,1,1,1919,1079==
wmctrl -r “zotero” -b toggle,shaded
BOTH DO NOT WORK :
wmctrl -r “KeePassXC” -b add,hidden
wmctrl -r “KeePassXC” -b toggle,minimized
wmctrl -r “KeePassXC” -b toggle,hidden
blijkbaar geen optie in wmctrl voor minimize , [UPDATE] blijkbaar een bug in een versie , die nooit meer gefixed werd
minimise an application window regardless of its current state
wmctrl -r "application-name" -b add,hidden
To maximise:
wmctrl -r "application-name" -b remove,hidden