dhimh
January 11, 2026, 12:38pm
19
After upgrading Qubes OS to 4.3 I’m now using xdotool, wmctrl and xprop and put everything I did with devilspie2 before in a single script, with a keyboard shortcut assigned. So it’s just a single keyboard shortcut to move all windows to the desired workspace, position, size, etc.
Examples can be found e.g. in the following forum topics:
Tips have been verified for R4.2 only unless otherwise noted; some might not work with R4.3.
Please let us know if you encounter a faulty tip.
VM Management
Shut down selected window’s VM - [dom0] Create /bin/halt-vm-by-window.sh (expandable), make it executable (chmod +x), then map to shortcut (e.g. super + esc) @tasket
halt-vm-by-window.sh
Open selected window’s qube settings - [dom0] Create /bin/open-settings-by-window.sh (expandable), make it executable (chmod +x), then map to sh…
Short guide explaining how you can use wmctrl to control windows, it’s useful if you want applications to automatically start on a specific desktop or screen.
The window list
$ wmctrl -l -x
0x048001dc 0 browser1:Navigator.browser1:Firefox-esr N/A N/A
0x046001dc 0 browser2:Navigator.browser2:Firefox-esr N/A N/A
0x04c001dc 0 browser3:Navigator.browser3:Firefox-esr N/A N/A
The list of active windows, and the identifier of each window.
Move window to desktop
$ wmctrl -x -r :Navigator.b…
Here are some shell scripts to help arrange windows without having to drag them with the mouse.
The scripts use xdotool and wmctrl to move and resize windows, the scripts work with multiple monitors as long as they have a similar size screen.
If you want to use different size screens, you are probably has to design a function to calculate the correct x-axis offset.
I made the scripts using 1920x1080 resolution, higher or lower resolutions might need to tweak some values.
shell scripts
top_…
xdotool also has a behave command which can run a command or script automatically, like
xdotool search --class <searchstring> behave %@ focus sleep 3 exec --sync /path/to/your/script
This way the script runs every time a window is focused, though, and not only when a window is created.