sway doesn’t support i3’s layout restoring feature, so we approximate the desired functionality by launching applications and repositioning their windows.
Pass a layout config as a parameter or on STDIN.
sway-layout layout.yaml
# or
sway-layout < layout.yaml
Defines the applications to launch, and where to position them.
- cmdline:
- firefox
match:
- "/usr/lib/firefox/firefox"
workspace: 1
output: HDMI-A-2
- cmdline:
- terminal
- "--class=torrents"
- "--working-directory=/mnt/storage"
env:
RUN: "ranger --selectfile=torrents"
workspace: 10
output: DVI-D-1
The command line to run. This is an array of arguments, so you don’t need to worry about escaping rules (although YAML does make it kind of awkward)
The process commandline to match against. Same behaviour as cmdline, and defaults to cmdline. Useful when the process who owns the window is different from the process specified by cmdline (e.g. emacsclient tells the emacs daemon to start a window, it doesn’t actually own it, and firefox on your PATH is actually a shell script that starts the real browser)
Environment variables to merge into the current environment when launching the application
The name of the workspace to move the application to
The identifier of the output to move the workspace to