Skip to content

Latest commit

Β 

History

73 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Omarchy Window Restore

Never lose a closed window again on Omarchy.

Replaces SUPER+W with a smarter close that saves windows to a history stack β€” so you can restore them with SUPER+R.

Works for all apps: browser windows, PWAs (Teams, ChatGPT, etc.), terminals, editors, and more.

Demo

πŸ“– Full documentation in the Wiki β€” Troubleshooting Β· App Compatibility Β· FAQ Β· Code Docs

Keybindings

All keybindings are automatically listed in Omarchy's built-in keybinding menu (SUPER+K).

Shortcut Action
SUPER+W Close window (saved to history)
SUPER+ALT+W Close window permanently (no history, cannot be restored)
SUPER+R Restore the last closed window
SUPER+SHIFT+R Restore all closed windows at once
SUPER+ALT+R Pick window to restore from a menu
SUPER+D Settings menu (mode, max windows, exclusions, workspace, bug report)

Restore Modes

Switch between modes anytime via SUPER+D β†’ Mode.

Relaunch Mode (default)

SUPER+W kills the window and saves the launch command. SUPER+R restarts the app fresh.

  • βœ… Low memory usage (process is gone)
  • ❌ App content is lost (browser tabs, unsaved state)
  • πŸ’‘ Browsers can recover tabs via built-in session restore

Hide Mode

SUPER+W moves the window to an invisible workspace. The process keeps running. SUPER+R brings it back exactly as it was.

  • βœ… Full state preserved β€” YouTube keeps playing, tabs stay open
  • βœ… Instant restore (no relaunch delay)
  • ❌ Uses more RAM (process stays alive)

Note: Switching from Hide β†’ Relaunch mode will close all currently hidden windows.

Settings Menu (SUPER+D)

The settings menu has three items:

Item Description
Mode Toggle between Relaunch and Hide mode
βš™ Settings Open sub-menu with all configuration options
πŸ› Create bug report Generate a bug report file in ~/Downloads/

βš™ Settings sub-menu

Option Description
Max windows Set how many windows are kept in history (default: 5, min: 1)
Exclusion list Exclude specific apps from history (e.g. terminals)
Pause media on close Pause media players when a window is closed/hidden (default: on)
Notifications Enable or disable desktop notifications (default: on)
Hide workspace The workspace number used to hide windows in Hide mode (default: 99)

Navigate back with ESC at any menu level.

Exclusion List

Apps on the exclusion list are closed normally but not saved to history. Useful for apps you never want to restore.

org.omarchy.btop (the system monitor) is excluded by default.

To add an app, open SUPER+D β†’ βš™ Settings β†’ Exclusion list and either:

  • Pick from open windows β€” select any currently open app
  • Enter app ID manually β€” type the window class directly

How to find the window class of an app

Run either of these commands:

# Class of the currently focused window
hyprctl activewindow -j | jq '.class'

# Classes of all open windows
hyprctl clients -j | jq -r '.[].class'

Common examples:

App Window class
Chromium chromium
VS Code code
Alacritty Alacritty
Spotify spotify
btop (Omarchy) org.omarchy.btop
Teams (PWA) chrome-teams.cloud.microsoft__-Default

How it works

When you press SUPER+W:

  1. The window class is checked against the exclusion list
  2. If not excluded, the window is saved to history
  3. In Relaunch mode: window is killed, launch command stored
  4. In Hide mode: window is moved silently to the hide workspace (invisible, process stays alive)

For Chromium-based apps, the window class is used to identify the correct launch command (not the PID, since all Chromium windows share one process):

  • class = chromium β†’ omarchy-launch-browser
  • class = chrome-teams.cloud.microsoft__-Default β†’ omarchy-launch-webapp https://teams.cloud.microsoft/

Note (Relaunch mode): App content (e.g. browser tabs) is not preserved β€” the app simply relaunches. For browsers, built-in session restore will recover tabs.

Requirements

  • Omarchy (Hyprland-based)
  • Python 3.10+
  • Omarchy's built-in menu (omarchy-menu-select/omarchy-menu-input, included with every Omarchy install, used for the picker and settings menus)

Install

Option 1: Git clone (manual)

git clone https://github.com/TimHerb2005/omarchy-window-restore.git
cd omarchy-window-restore
bash install.sh

Option 2: AUR package

Install via any AUR helper:

yay -S omarchy-window-restore-git

Then activate for your user:

omarchy-install-window-restore

Or via the Omarchy Menu: Install β†’ AUR β†’ type omarchy-window-restore-git, then run omarchy-install-window-restore in a terminal afterwards.


Both options:

  • Copy scripts to ~/.local/bin/
  • Add keybindings to ~/.config/hypr/bindings.lua (Omarchy "Quattro"/Hyprland 0.56+) or bindings.conf (older Omarchy), detected automatically
  • Hyprland reloads the config automatically β€” no restart needed

Optional: native Quickshell plugin (Omarchy "Quattro" only)

On Quattro, SUPER+D/SUPER+ALT+R can open native Quickshell overlays instead of the omarchy-menu-select/omarchy-menu-input menus above β€” same functionality, themed like the rest of the system, plus a "Window Restore" entry in the Omarchy menu. Install the base tool first (either option above), then:

bash plugin/extras/install.sh

See plugin/README.md for details and how to uninstall it.

Uninstall

bash uninstall.sh

Removes all scripts, keybindings and the history cache. SUPER+W returns to its default behavior.

Files

~/.local/bin/
β”œβ”€β”€ hypr-close-window           # SUPER+W: save to history/hide, then close
β”œβ”€β”€ hypr-restore-window         # SUPER+R: restore last window
β”œβ”€β”€ hypr-restore-all            # SUPER+SHIFT+R: restore all windows
β”œβ”€β”€ hypr-restore-picker         # SUPER+ALT+R: pick window to restore (menu)
└── hypr-restore-settings       # SUPER+D: settings menu

~/.cache/
β”œβ”€β”€ hypr-window-history.json    # Relaunch mode history (max N entries)
β”œβ”€β”€ hypr-restore-hidden.json    # Hide mode address list (max N entries)
β”œβ”€β”€ hypr-restore-mode           # Current mode: "relaunch" or "hide"
└── hypr-restore-config.json    # Settings: max_windows, excluded_classes, hide_workspace, ...

License

PolyForm Noncommercial License 1.0.0 β€” free for personal and non-commercial use, commercial use is not permitted.

About

Never lose a closed window again on Omarchy. Save & restore windows with SUPER+W / SUPER+R.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages