Firefox settings restore as closed

MATE 21.04 vanilla installation.
In ubuntu 20.04 it is possible with GNOME extension Put Windows to set keyboard shortcuts and configure windows such hat they can be sized and placed according to preference with a keystroke.

I'm trying to achieve the same with MATE and Firefox, such that Firefox always opens in te same condition (size and position) as it was when closed or at least to use a keyboard combination to move/resize to the screen in the specified place (top left corner to bottom bar and 2/3rds width).

Is this achievable in MATE or is there an alternative method?

Hi :slight_smile:

I think you can use devilspie to accomplish such behavior.

You can read about it here :

https://help.ubuntu.com/community/Devilspie

I'm using it in many cases but there is a app that I want to run in a special geometry :

(if 
  (contains (application_name) "terminator")
  (geometry "1088x555+25+52")
)

Good luck :slight_smile:

1 Like

I'm with olek on this: devilspie is the tool you want.
$ cat ~/.devilspie/firefox.ds
(if (is (application_name) "Firefox") center)

AFAIK, devilspie does not respond to keybinds: it's only for setting properties on window creation. But I could be wrong, since this is all I need from it.

IIRC Firefox will actually remember the window SIZE itself, just not the position. If your saved FF window is already the height of your desktop, as mine is, y=0 is the only position it CAN go, so only the x pos needs adjusting. This simplified pseudo-geometry means I don't have to keep making custom versions depending on which machine it's on.

For anything more advanced though, yeah: use olek's example instead. gl. :slight_smile:

2 Likes

@arQon Thanks. I don't need it to be complex and just opening the FF window in the same place/condition as closed will be fine but it seems currently inconsistent. Sometimes it will reopen correctly other times not which is the frustrating bit. @olek has a good solution but seems to me like a sledge hammer to crack a relatively simple nut!

I'm sure devilspie will help you also on other similar cases :slight_smile: It's a good friend to have installed :slight_smile:

just opening the FF window in the same place/condition as closed will be fine but it seems currently inconsistent

Makes sense. Like I say, Firefox DOES remember the size, but DOESN'T remember the position. Assuming you have the window maxed vertically, it can't randomly position it on that axis, only left to right. And, there, it'll just end up "wherever".

So yeah: I'd say install devilspie, try either my super-simple method or olek's more specific version, and settle on whatever works best for you. Because the important thing here is this: yes, it sucks that Firefox doesn't remember its position properly (even more annoying is that it DOES actually store it all, and "Restore Session" will also reposition it correctly: it just doesn't do that by default) - and yes, devilspie is a "bigger" solution than you "really" need. But so what? FF's behavior is stupid, and it's annoying you.

You can resolve that annoyance with very little effort, so you should. Forcing yourself to have to put up with bad behavior on a daily basis just because you "shouldn't have to" is basically just spiting yourself. Fix it, move on, and never worry about it again. :slight_smile: