GNOME session save and restore

Save and restore your desktop active running application windows and their positions across multiple workspaces using a GNOME Shell extension.

Installation:

Download the extension:
>wget -O- https://github.com/arnon-weinberg/session-3/tarball/master | tar xz

Or download the project:
>git clone https://github.com/arnon-weinberg/session-3.git

Then install the extension:
>mv *session-3* ~/.local/share/gnome-shell/extensions/session@research-lab.ca
Log out of GNOME and log back in.
>gnome-extensions enable session@research-lab.ca

Use cases:

  • Restore workspace after reboot from kernel upgrade, hardware upgrade, non-recoverable error, battery died, or power outage.
  • Desktop layout messed on laptop after unplugging from an external monitor.
  • Restarting an application with multiple windows across workspaces.
  • Reopen application that crashed or was closed accidentally.
  • Remember and automatically restart open running active apps.
  • Reset application window geometries and arrangements over multiple desktop workspaces.

Details:

The extension menu should appear on the top-right corner of the GNOME Shell desktop.

Save session: Save current desktop session
Restore session existing: Restore geometries of existing windows
Restore session matching: Restore geometries of matching windows
Restore session missing: Restore geometries of missing applications

Limitations:
Tested on AlmaLinux 9 GNOME Shell 40 with Wayland.
Restoring applications (Restore session missing) only launches applications; it cannot restore their previous state – that is up to each application to do.
Some applications handle their own session save and restore, but they don’t handle restoring geometries. Thus, restoring a session can be a 3-step process sometimes: (1) Restore session missing to restart the application, (2) follow the application’s session restore process, and (3) Restore session matching to restore its geometries.

Note: The extension never closes windows; it ignores windows not in the saved session.

Leave a Reply

Your email address will not be published. Required fields are marked *