Use xsession directly.
Forgotten give_info function to have class of windows.
Quit using my function.
correcting/adding some rule for positioning apps