swaytreesaveis a command-line tool that enables users of the Sway window manager to save and restore their window layouts effortlessly. Whether you're switching tasks or rebooting your system,swaytreesaveensures your workspace remains consistent and organized.
- Save and load your sway tree (layout)
- Exec customisation
- Timeout customisation per item
- Retry customisation per item
- Save and load multiple trees/layouts giving a name
- Load specific workspace of specific tree
- Supports multiple WM/compositors:
git clone git@github.com:fabienjuif/swaytreesave.git
cargo install --path ./swaytreesaveYou can find a custom template here.
swaytreesave --help
Usage: swaytreesave [OPTIONS] <COMMAND>
Commands:
save Save your current sway tree
load Load a sway tree
help Print this message or the help of the given subcommand(s)
Options:
--name <NAME> Name of your tree
--compositor <COMPOSITOR> Compositor to use [default: sway]
--dry-run Dry run
--no-kill No kill
-h, --help Print help
-V, --version Print versionswaytreesave load --help
Usage: swaytreesave load [OPTIONS]
Options:
--workspace <WORKSPACE> Specify the workspace to load. Other workspaces app will not be killed, and only this workspace apps will be loaded from config file
-h, --help Print helpSaves the current tree to $HOME/.config/swaytreesave/default.yaml:
swaytreesave saveLoads the default tree back:
swaytreesave load# trees loader
# needs https://github.com/fabienjuif/swaytreesave
set $treeload_mode 'load tree (d|p:default, w:work)'
mode $treeload_mode {
bindsym d exec swaymsg 'mode "default"' && swaytreesave load
bindsym p exec swaymsg 'mode "default"' && swaytreesave load
bindsym w exec swaymsg 'mode "default"' && swaytreesave --name work load
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+t mode $treeload_mode