Recall Windows (Save and restore window layouts on Linux/X11)

Recall Windows

Save and restore window layouts on Linux/X11


Description

Recall Windows saves the layout of your open windows (position, size, workspace) and restores it in one click. Perfect for instantly recovering your usual work environment after a reboot or a different work session.

Features

  • Save windows per workspace
  • Selective restore by desktop and application
  • GTK3 graphical interface with checkboxes
  • Autostart toggle โ€” restore your layout automatically at session start
  • Automatic exclusion of system windows (conky, etc.)
  • Intelligent mapping of server processes to the correct launch commands
  • Real-time feedback during restore
  • French :france: ยท English :united_kingdom: ยท German :germany:

Requirements

sudo apt install wmctrl xprop python3-gi

Installation

Run the installer from the folder containing recall-windows.py chmod +x install-recall-windows.sh ./install-recall-windows.sh

The installer copies the script to ~/.local/bin/ and creates a launcher in ~/.local/share/applications/.

Usage

Command line

  • Save the current layout python3 recall-windows.py -read
  • Restore the saved layout python3 recall-windows.py -run
  • Open the graphical interface python3 recall-windows.py -ui

Graphical interface

The interface displays saved desktops and applications with checkboxes to select what you want to restore.

  • Save โ€” saves the current layout and refreshes the list
  • Restore โ€” restores checked windows to their saved position
  • Autostart โ€” toggles automatic restore at session start (creates/removes ~/.config/autostart/recall-windows.desktop)

Save file

The layout is stored in ~/.windowlist in the following format:

workspace x y width height command

Example:

0 0 0 1920 1080 /opt/brave.com/brave/brave
1 960 0 960 540 gnome-terminal --window
1 960 540 960 540 nautilus -w

Keyboard shortcut

Via system settings โ†’ Keyboard shortcuts โ†’ Custom shortcut:

Command Suggested shortcut
python3 ~/.local/bin/recall-windows.py -ui Super+R
python3 ~/.local/bin/recall-windows.py -run Super+Shift+R

Adding an application to CMD_MAP

If an application does not restore correctly, add its mapping in the script:

CMD_MAP = { "/usr/libexec/gnome-terminal-server": "gnome-terminal --window", "/usr/bin/nautilus --gapplication-service": "nautilus -w", # Add your applications here "/usr/lib/firefox/firefox": "firefox --new-window", }

To find the exact process command of an application:

cat /proc/$(pgrep -f myapp)/cmdline | tr '\0' ' '

Limitations

  • X11 only โ€” not compatible with Wayland
  • Requires wmctrl and xprop
  • Restore is sequential โ€” each window waits to be visible before moving to the next
1 Like

You forgot the Link to download it.

Thank you, I need one more coffee :wink:

1 Like

Or a nice Tea as Distraction.

2 Likes

A japanese sencha green tea is nice :grin:

I have tested your app in a Zorin 18.1 Core live session, but in live session it didn't work correctly.
The command 'sudo apt install xprop' was not found. I'm not sure if that is maybe the cause. It seems to be installed in the package x11-utils.
The position of the windows was not correctly restored after logout.
Only the windows from workspace 1 were restored, not from other workspaces.

The gnome extension "Another Window Session Manager" instead worked well.

Please tell me if you are not interested in tests and feedback in live session.

Thank you but it's really not made for live session, but I appreciate you offer :wink: