sway-move-here
is a helper tool to move all the workspaces to the
current output in Sway window manager.
In a nutshell it does the following:
- Retrieve all the outputs (displays) and workspaces.
- Move all the workspaces to the output that is currently focused.
- Switch back to the workspace that was originally focused.
The project is developed on sourcehut, there is also a github mirror.
Just run sway-move-here
binary after building it.
One can also bind it to a key combo in Sway config (see man 5 sway
), e.g.:
bindsym --to-code $mod+Control+apostrophe exec --no-startup-id /path/to/sway-move-here
If the tool doesn't work as expected, one can increase output verbosity:
- flag
-v
will displayswaymsg
commands and their exit codes - flag
-vv
will additionally print standard output of those commands
The tool is written in Rust lang 2018 edition, uses Cargo as a build tool and rustup as a toolchain manager.
The tool is statically compiled using musl by default, so one'll need to install the appropriate target first:
rustup component add x86_64-unknown-linux-musl
Once that is done once, the tool can be built using Cargo:
cargo build --release
Binary target/x86_64-unknown-linux-musl/release/sway-move-here
can
now be copied to any location.
The tool doesn't have automated tests (yet), but it works. I swear!