Ubuntu – How to remember a window position in gnome shell


I'd like every window in gnome shell to open in the state and position used when I closed them, or at least, if that's not possible, to let me configure how they should open.

I noticed that some applications (atom editor, files, for example) seem to remember the window size but not it's position, and others seems to open always in the same way (terminator).

For example, every time I open terminator I tile it to the left, I'd like some way to configure it so that it should always open like that.

BTW, I'm using Ubuntu Bionic Beaver development branch

Best Answer

I could achieve something like that using devilspie2 (also check here for a few tips https://help.ubuntu.com/community/Devilspie)

sudo apt install devilspie2 lua5.2

and then created the following file at ~/.config/devilspie2/terminator.lua

if (get_application_name() == "terminator") then
  -- x,y, xsize, ysize
  set_window_geometry(683, 32, 683, 768);

Nevertheless I still can't exactly reproduce gnome shell's behavior. If I tile terminator to the left win win-left, the windows decoration disappears, and it appears again if I restore it, with this lua script windows decoration remain visible

And finally to make it autostart I created the following file at ~/.config/autostart/devilspie2.desktop

[Desktop Entry]
Comment="devilspie2 process"