The question is published on by Tutorial Guruji team.
I want to dynamically using a bash script/c++ code arrange windows that are present on the desktop on top of each other .I know the name of the applications whose windows will be present on the gnome desktop.
Is there any way to achieve this ?
Take a look at Devil’s Pie. This is a window-matching utility that was especially written for the Metacity window manager, IIRC. It allows you to execute custom actions for certain types of windows. In your case, you could simply match all windows and set their respective positions/geometries (I don’t know the manual of Devil’s Pie by heart, but I am pretty sure that it can do this).
There’s also a successor, called Devil’s Pie 2, which uses Lua-based rules. However, I don’t have any further information about it.