I have written a bunch of dash scripts that resize and move windows for better efficiency.
The structure is the following: i have a row of 8 windows that are stacked to the bottom of my screen, like thumbnails if you will. Let's call each of those windows miniportal_1,...,miniportal_8
When i want to work with one of them a script resizes it above the row so that it occupies the remaining part of the screen and becomes mainportal
To better visualize, the concept is inspired by the fighter jet F-35 displays (See image)
What i want to do is that if there's already one mainportal present, the miniportal window that i resize replaces it but also that the mainportal window is resized and moved to the former miniportal image. So in short i want to swap the miniportal and portal windows.
I think what i need to do something like that:
1/store the ID, geometry and coordinates of all visible windows using wmctrl
visible_windows_ID_array=wmctrl -l -G | awk '{print S1}'
visible_windows_geometry=same but with different awk option
visible_windows_coordinates= same but with different awk option
2/Do a for loop with an if test to get the ID of the mainportal window
for((i=0;i<${#get_visible_windows_ID_array[@]}; i++ )) do
and this is where i can't find the correct syntax for the If test. I want to do something like that:
if visible_windows_geometry[i]= mainportal geometry && visible_windows_coordinates[i]= mainportal coordinates then
get visible_windows_ID[i]
fi
done
Once i have the mainportal window ID i can use wmctrl -r to resize it.
Any idea on how i could do that?