/sway-session

Tool for saving the state of the Sway WM session and restoring it

Primary LanguageGoMIT LicenseMIT

sway-session

Tool for saving the state of the Sway WM session and restoring it.

At the moment, it is a PoC!

Actions Status Go Report Card GoDoc

Usage

For saving the running programs and its workspace disposition run the given command:

sway-session save

It will create a json file at $XDG_DATA_HOME/sway-session/sessions/.

To restore simply use:

sway-session restore

The recomendation would be to place at the sway config file something like that:

exec sway-session restore

There is a command for constantly save your session:

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:

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.

  • current working directory