This question shows how one can address a window by it's title, and then position/resize it around.
Now to address a window there are five options:
- The window's ID: Changes on application restart => Useless
- The window's Title: Identical with the title of other windows => Useless
- The window's Namespace: Identical with the namespace of other windows => Useless
- User selectable via clicking => The whole point of this is to be lazy, isn't it?
- The active window will be used => Maybe, but I feel like this could be unreliable (?)
What I want to do is to have a script open a bunch of applications, a few of them more than once (same or variable title) and position them on my desktops. Note the plural, I want some of them to go on another workspace aswell.
wmctrl is capable of doing all that moving and resizing, but I'm not sure how to do the window selection.
Is there a way to get the Window ID right after starting the app? I know you can do this for the process ID, and
wmctrl is able to get the PID for all apps I'm running, so is there a way to address a window using it's PID?
wmctrl do the title matching in reverse? (The
--help says the first match will be used, is it possible to use the most recently started (so I assume last) match instead?)