Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norio-nomura/restore-windows
Restore windows on launching Atom.
https://github.com/norio-nomura/restore-windows
Last synced: 5 days ago
JSON representation
Restore windows on launching Atom.
- Host: GitHub
- URL: https://github.com/norio-nomura/restore-windows
- Owner: norio-nomura
- License: mit
- Created: 2014-08-11T12:22:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-22T00:11:54.000Z (almost 10 years ago)
- Last Synced: 2025-01-04T17:10:30.342Z (20 days ago)
- Language: CoffeeScript
- Homepage: https://atom.io/packages/restore-windows
- Size: 256 KB
- Stars: 6
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
** !! Atom [v0.193.0](http://blog.atom.io/2015/04/21/atom-is-faster-resizable-saves-app-state.html) supports restoring window state. You won't need this package any more!! **
# Restore Windows
Restore windows on launching [Atom](http://atom.io).
## What is this?
Atom identifies *window* by *project's path* `atom.project.getPaths()` and remembers every opened *project*'s states including *window*. ~~But Atom does not remember which *projects* were opened on quitting.~~ **Atom [v0.193.0](http://blog.atom.io/2015/04/21/atom-is-faster-resizable-saves-app-state.html) supports restoring window state. You won't need this package any more!!**This package remembers and opens them on launching instead of Atom.
## Installation
```sh
apm install restore-windows
```Alternatively open `Preferences -> Packages` and search for `Restore Windows`.
## How does work this?
Atom loads packages to each of *windows* on every opening as their own instances. But `atom.config` is not usable for saving information from multiple instances in same time on closing *windows* by quitting Atom.Instead of using `atom.config`, this package use following files:
- **opened directory** (`~/.atom/restore-windows/opened/`)
Each instance save a file containing their *project path* on loading and remove it on `beforeunload`.
- **may be restored directory** (`~/.atom/restore-windows/mayBeRestored/`)
Every instance save a file containing their *project path* on `beforeunload`.
This package restore *windows* as following steps:
1. If **opened directory** is not empty, another instance of Atom window is exists. Stop restoring.
2. Collect *project path* and *timestamp* from **may be restored directory**. If *timestamp* is **near past (default: 5sec)** from latest, *project* should be opened.
3. Remove files from **may be restored directory** on enumeration.
4. Call `atom.open()` passing *project paths* for openeing windows.
5. Atom will restore all windows state on openeing it.## License
MIT