I am using several Chrome windows (3-5) with many open tabs on each and I am using "On startup" > "Continue where you left off" settings. The problem is, when I start the chrome, all the windows are open on current workspace (I am using 4 workspaces). What I need to do is to move each window to specific workspace. I need to select window by it's ID because title of the window might be always different (depending which tab is on focus). It is bit annoying to move the windows to right workplace manually all the time.
This is the output of my wmctrl -l
command:
wmctrl -l
0x01e00002 0 posuk13-PCSPEC XdndCollectionWindowImp
0x01e00005 0 posuk13-PCSPEC unity-launcher
0x01e00008 0 posuk13-PCSPEC unity-panel
0x01e0000b 0 posuk13-PCSPEC unity-dash
0x01e0000c 0 posuk13-PCSPEC Hud
0x0300000a 0 posuk13-PCSPEC Desktop
0x04400001 0 posuk13-PCSPEC Inbox - [email protected] - Gmail - Google Chrome
0x04400039 0 posuk13-PCSPEC How to move Chrome windows using wmctrl? - Ask Ubuntu - Google Chrome
0x0440003a 0 posuk13-PCSPEC YouTube - Google Chrome
0x0440003b 0 posuk13-PCSPEC Online regex tester and debugger: JavaScript, Python, PHP, and PCRE - Google Chrome
And now let's say I need to move the YouTube window to workspace #2. The following command works:
wmctrl -r YouTube -e 0,2000,0,-1,-1
and also this works:
wmctrl -r 0x0440003a -i -e 0,2000,0,-1,-1
But the problem is that the window ID is different every restart and it's title is different every time I switch tab. Is there a way to select window by part (last 3-4 digits) of it's ID (it seams that last 2-3 digits are always the same when I start the window right after reboot), or to select e.g. 7th window from the list? The reason I need this is I want to write script that will start all required applications (Chrome, Apache, SublimeText...) and move windows to specific workplaces (I have one workplace for e-mail/Facebook, one for music and one for work stuff).
PS: Please do not suggest using system hibernation - it is not an option for me because of some driver issues.
PS2: I am using Ubuntu 15.04