https://github.com/gumieri/sway-session
Tool for saving the state of the Sway WM session and restoring it
https://github.com/gumieri/sway-session
desktop session sway swaywm
Last synced: 12 months ago
JSON representation
Tool for saving the state of the Sway WM session and restoring it
- Host: GitHub
- URL: https://github.com/gumieri/sway-session
- Owner: gumieri
- License: mit
- Created: 2019-11-25T05:09:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-12T07:49:49.000Z (over 3 years ago)
- Last Synced: 2025-04-25T19:16:43.118Z (about 1 year ago)
- Topics: desktop, session, sway, swaywm
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 56
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sway-session
Tool for saving the state of the [Sway WM](https://swaywm.org) session and restoring it.
**At the moment, it is a [PoC](https://en.wikipedia.org/wiki/Proof_of_concept)!**
[](https://github.com/gumieri/sway-session/actions)
[](https://goreportcard.com/report/github.com/gumieri/note)
[](https://godoc.org/github.com/gumieri/sway-session)
## Usage
For saving the running programs and its workspace disposition run the given command:
```bash
sway-session save
```
It will create a json file at `$XDG_DATA_HOME/sway-session/sessions/`.
To restore simply use:
```bash
sway-session restore
```
The recomendation would be to place at the sway config file something like that:
```config
exec sway-session restore
```
There is a command for constantly save your session:
```bash
sway-session save-loop 120
```
It will save your session every 2 minutes, informed in seconds. If the seconds are not informed it will assume the default value, which is 1 minute.
The recomendation way to use it would be something like:
```config
exec sway-session restore && sway-session save-loop
```
## Supported programs
Considering that a lot of programs have different ways of retrieving it state and restoring it to the desired state,
the `sway-session` can only offer a generic approach for all the ecosystem and for more specific programs (like terminal-emulators)
to offer some rules with more capabilities.
### → [alacritty](https://github.com/jwilm/alacritty)
* current working directory