Option for restoring previous session

how can I automatically restore the previous session upon login (i.e. previously open windows, terminals with the respecttive tabs etc.).
Had that going on centos and can’t find the options on rocky.

Cheers,
frank

Rocky 9 has GNOME 40. CentOS had GNOME 3. You should check from GNOME how/if session save&restore is possible in 40.

I don’t remember this is CentOS, but it doesn’t make sense to me anyway. Do you mean you can somehow leave the computer with unsaved office documents, half watched videos, half printed pages, data about to be flushed to disk, and you come back after the computer has been powered off, and it all comes back as if nothing happened?

No, I think that would be closer to “suspend” on a laptop.

I think he means that he wants his windows and desktops to re-open as he left them. If he has ten windows open when he logs out he wants them on the screen and in the same positions when he logs back in.

Every time I log in I load my email program, my web browser, a couple of terminals, etc. Don’t you?

That’s right. If I have a terminal with ten tabs openn as well was chrome etc, I’d like those to re-open as I left them when I logged out.

Qt docs talk about session management from the application’s viewpoint: https://doc.qt.io/qt-6/session.html

That is, some applications can save their state (e.g. size and location of windows, etc), particularly on exit, and restore to last saved state on start. Logically, from DE’s side the task is to start the same applications that were running during last user session (i.e. the DE must save that state info on logout).

Note how Qt mentions X11. The Wayland may have different procedures and/or call hooks.

Gnome used to have a checkbox on its user logout screen “Are you sure you want to log out?” that you could select to save your session.

I guess that option got lost over the years.

Yeah, there was an option to save your session on logout in older versions of gnome which I am sorely missing. Something like this:

We often have many terminals open with custom titles which is a pain to set up each time after logging out.
Will investigate solutions as it feels like this should be doable somehow (I’m no linux wiz though), but if anybody has further thoughts I’d be keen to hear them.

sounds like gnome-session-selector should help:

DESCRIPTION
gnome-session-selector can be used from a xsession desktop file to select a session before gnome-session is run. gnome-session reads and stores its session in the
$XDG_DATA_HOME/gnome-session/saved-session directory. gnome-session-selector works by replacing the saved-session directory by a symlink to another directory. Since
the session name is used as the directory name, it may not contain ‘/’ characters or begin with a ‘.’.

However the XDG_DATA_HOME env var does not exist and setting it doesn’t seem to do anything.

From XDG Base Directory Specification

$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

It looks like this was a Gnome 2.x feature, which explains why I don’t remember it.

Terminal windows are more than just windows, they are also applications with state, so would the “restore” somehow re-start those applications? If you were ssh’d into a remote server on one of the terminals, would the restore re-connect you back to the remote server?

As I recall, the session restore just reloaded your programs and put the windows back where they were before. So your email client would be loaded, your terminals would be sitting at a prompt, and your desktop would look pretty much the same as before.

It didn’t get any fancier than “load program x”. What program x did after it was loaded was up to program x.

1 Like

that’s all I am after

Perhaps Another Window Session Manager - GNOME Shell Extensions

Oh excellent, will test this, thank you very much!!