Skip to content

A Gnome shell extension to close open windows gracefully and save them as a session. The previous session can be restored at startup. Most importantly, it supports both X11 and Wayland!

License

Notifications You must be signed in to change notification settings

nlpsuge/gnome-shell-extension-another-window-session-manager

Repository files navigation

gnome-shell-extension-another-window-session-manager

Close and save open windows. And restore from a saved windows session.

Most importantly, it supports both X11 and Wayland!

This project is in early development, but it's basically working now. More features will be added in the future.

This extension is based on several Gnome technologies and APIs including Meta, Shell and St(Shell Toolkit).

Get it on GNOME Extensions

Screenshot

Overview

image

Close open windows

Click item to close open windows:

image

After confirm to close:

image

Save open windows

Click item to save open windows as a session:

image

After confirm to save:

image

Main features

  1. Close open windows
  2. Save open windows
  3. Restore saved open windows and move windows to their own workspace automatically in the progress
  4. Restore window state, including Always on Top, Always on Visible Workspace and maximization
  5. Restore window size and position
  6. Move windows to their own workspace according to a saved session
  7. Trash saved session
  8. Search saved session by the session name fuzzily
  9. ...

Panel menu items

Icons description

Icon Description
Save open windows as a session, which name is the item's name
Restore the saved session using the item's name
Move the open windows using the item's name
Close the current open windows

Dependencies

This project uses ps to get some information from a process, install it via dnf install procps-ng if you don't have.

Known issues

  1. On both X11 and Wayland, if click restore button () continually during the process of restoring, the window size and position may can't be restored, and it may restore many instances of an application. As a workaround, click the restore button () only once until all apps are restored.
  2. On Wayland, if a window is maximized along the left or right sides of the screen before closed, its size and position can't be restored. As a workaround, click the move button () to restore their size and position.
  3. On both X11 and Wayland, due to this bug within mutter, in Overview, if click restore button () then immediately click the newly created workspace, the Gnome Shell can crash. To fix this issue, the Overview will be toggled hidden after clicking the restore button () when in Overview. I will remove this behaviour once I find a better solution or it's fixed in a new version of Gnome Shell.
  4. If an application launched via a command line and it doesn't have a .desktop, it can't be moved to its own workspace, can't be restored both size and position. Please click the app icon to launch an application before saving it in the session and restore.
  5. ...

Where are the saved sessions?

They are all in ~/.config/another-window-session-manager/sessions. When use an existing name to save the current open windows, the previous file will be copied to ~/.config/another-window-session-manager/sessions/backups as a new name, which is the-old-session-name**.backup-current-timestamp**.

Note that I've marked backups as a reserved word, so you can't use it as a session name when saving a session. But you do have the freedom to create manually a file named backups in ~/.config/another-window-session-manager/sessions. But this extension will only backup the session file that you are clicking the save button and you will receive an error log in the journalctl and an error notification every time you save an existing session.

TODO

    • Save open windows
      • Save open windows
    • Restore saved open windows
      • Restore saved open windows
      • Move to belonging workspace automatically
      • Restore window size and position (issue 17)
      • Restore window workspace, size and position of applications launched via a command line and don't have a recognizable .desktop file by Shell.AppSystem.get_default().get_running().
      • Support dual-monitors (issue 21)
    • Saved open windows list
      • Save open windows button
      • Restore button
      • Rename button (double click text to rename?)
      • Move button
      • Delete button
    • Move windows according to a saved session.
    • Settings
      • Debugging mode
      • whitelist using for closing application with multiple windows
    • Support restoring a saved session when startup (issue 9)
    • Support saving and closing windows when Log Out, Power off, Reboot (issue 9)
    • All TODO tags in the projects