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).
Click item to close open windows:
After confirm to close:
Click item to save open windows as a session:
After confirm to save:
- Close open windows
- Save open windows
- Restore saved open windows
- Restore window state, including
Always on Top
,Always on Visible Workspace
and maximization - Restore window workspace, monitor, size and position
- Move windows to their own workspace according to a saved session
- Move windows to their own monitor according to a saved session
- Trash saved session
- Search saved session by the session name fuzzily
- ...
This project uses ps
and pwdx
to get some information from a process, install it via dnf install procps-ng
if you don't have.
- 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.
- 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.
- 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 behavior once I find a better solution or it's fixed in a new version of Gnome Shell.
- ...
Support applications launched via a command line or applications that don't have a proper .desktop file
If the .desktop is missing from a session file, restoring an application relies on the command line completely.
In this case this extension will generate a .desktop in the journalctl
when you click the save button (). Search Generated a .desktop file
in journalctl /usr/bin/gnome-shell -r
to find it: journalctl /usr/bin/gnome-shell -b -o cat --no-pager | grep 'Generated a .desktop file'
. To make it work, You need to copy it to ~/.local/share/applications
, and relaunch the app and save the session again. This extension should be able to restore the workspace, state, size and position of this application.
The generated .desktop might not work sometimes, it's better to check whether the value of Exec
is correct or not. If you restore an app using a bad .desktop, this extension will give you a notification and log error level logs in the journalctl
.
I tested on Anki, VirtualBox machine and two .AppImage apps, they all have no .desktop and are launched in the terminal. By using the generated .desktop, Anki, VirtualBox machine works. One .AppImage app works. Another .AppImage app is Wire_x86_64.AppImage
and doesn't work, because the command line returned is something like /tmp/.mount_Wire-3xxxxx/wire-desktop
, you can use it to launch Wire but files in the /tmp
will be deleted during the OS shutdown and start.
It's impossible / hard to query the command line from a process, the pid of a window might not be right too and I don't find a standard way for this.
One of the following should be enough to prove the .desktop is not proper:
- Right click on the icon in the panel or dash, if there is no
Add to Favorites
in the menu - This extension can launch an application, but can't move the window to its workspace. (But it might suggest there is a bug in this extension, LOL :))
Most existing applications should have a proper .desktop. I'm just handling the special case. Someone like myself might want this feature.
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 manually create 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.
-
- Save open windows
- 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 byShell.AppSystem.get_default().get_running()
. - Support dual-monitors (issue 21)
- Restore saved open windows
-
- Saved open windows list
- Save open windows button
- Restore button
- Rename button (double click text to rename?)
- Move button
- Delete button
- Saved open windows list
-
- Move windows according to a saved session.
-
- Settings
- Debugging mode
- whitelist using for closing application with multiple windows
- Settings
-
- 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