You can manipulate windows using wmctrl
and xdotool
, and in addition, daemons such as devilspie
and devilspie2
allow you to define rules for specific windows. When a window is created that matches your criteria, these tools can automatically manipulate them, i.e. resize and position them, and move them to a different workspace. You will mist likely need to be logged in on the Xorg server (default prior to Ubuntu 21.04). They may not work, or at least be limited, under Wayland.
wmctrl and xdotool
If you only need to set up a configuration at login, you can work with wmctrl
and xdotool
. With wmctrl
, you can move to a different workspace, then have your script launch an application. xdotool
may then be most suited to "search" the window and resize and place it. It features a --sync
option that causes the command to wait until the window is effectively created.
devilspie or devilspie2
devilspie2
is a successor of devilspie
that uses a different syntax (Lua) in the configuration file. With these tools, you define rules in which you state what should happen with a window that matches certain criteria. As soon as such window is created, devilspie
will manipulate it according to the instructions, i.e., resize and position it, move it to a different workspace, ...
Thus, you could define rules for the specific Firefox windows you want to place during startup. When the windows are created by an autostarter or by a script you run on startup, devilspie
will manipulate them automatically as they are created.