The Problem
On Omarchy, pressing SUPER+W closes a window permanently. If you accidentally close a browser window, a Terminal, or a PWA — it's gone. You have to reopen the app, navigate back to where you were, and potentially log in again.
The Idea
Replace SUPER+W with a smarter close that saves the window to a history stack. A second keybinding restores the last closed window.
This is particularly useful for:
- Browser windows accidentally closed
- PWAs (Teams, ChatGPT, etc.) where state matters
- Any app where re-navigating is annoying
Implementation
I built this as an AUR package and have been running it on Omarchy for a while:
Keybindings
| Shortcut |
Action |
SUPER+W |
Close window (saved to history) |
SUPER+R |
Restore last closed window |
SUPER+SHIFT+R |
Restore all closed windows |
SUPER+ALT+R |
Pick window from a menu |
SUPER+CTRL+R |
Settings |
SUPER+ALT+W |
Close permanently (original killactive behavior) |
Two modes
Relaunch (default): kills the process, relaunches on restore — low memory, works for all apps.
Hide: moves the window to an invisible workspace — full state preserved, YouTube keeps playing, instant restore.
Everything is opt-in and reversible
The feature is packaged separately (omarchy-window-restore-git on AUR) so it doesn't affect anyone who doesn't install it. An uninstall command removes all scripts, keybindings and cache files completely.
PR
I've also opened a PR (#5425) that adds omarchy-install-window-restore to Omarchy's installer scripts, following the same pattern as omarchy-install-tailscale, omarchy-install-vscode, etc. This would make it installable from the Omarchy menu.
Happy to discuss the approach or adjust anything to fit Omarchy's conventions better.
The Problem
On Omarchy, pressing
SUPER+Wcloses a window permanently. If you accidentally close a browser window, a Terminal, or a PWA — it's gone. You have to reopen the app, navigate back to where you were, and potentially log in again.The Idea
Replace
SUPER+Wwith a smarter close that saves the window to a history stack. A second keybinding restores the last closed window.This is particularly useful for:
Implementation
I built this as an AUR package and have been running it on Omarchy for a while:
Keybindings
SUPER+WSUPER+RSUPER+SHIFT+RSUPER+ALT+RSUPER+CTRL+RSUPER+ALT+WTwo modes
Relaunch (default): kills the process, relaunches on restore — low memory, works for all apps.
Hide: moves the window to an invisible workspace — full state preserved, YouTube keeps playing, instant restore.
Everything is opt-in and reversible
The feature is packaged separately (
omarchy-window-restore-giton AUR) so it doesn't affect anyone who doesn't install it. An uninstall command removes all scripts, keybindings and cache files completely.PR
I've also opened a PR (#5425) that adds
omarchy-install-window-restoreto Omarchy's installer scripts, following the same pattern asomarchy-install-tailscale,omarchy-install-vscode, etc. This would make it installable from the Omarchy menu.Happy to discuss the approach or adjust anything to fit Omarchy's conventions better.