sway-yasm
Sway's yet another sway manager is a daemon for managing Sway WM's windows, workspaces, outputs, clipboard and PATH using FZF - both as floating foot windows and in the terminal.
It tries to deliver all these features in one command, without any configuration, and with a single binary, so it can be deployed easily:
sway-yasm daemon --default-keybindings
| switcher | path |
|
|
| pick-space | pick-win |
|
|
| clipboard | |
|
install
Install using one of the following ways:
- binary from the releases page
go install github.com/pancsta/sway-yasm/cmd/sway-yasm@latestgit clone; cd; ./scripts/build
features
- window / workspace management
- alt+tab / MRU order for windows
- move a workspace to the current output
- move a window to the current workspace
- miscellaneous management
- run anything in your
PATH - copy from clipboard history using
clipmanandwl-clipboard
- run anything in your
- user command files (scripts)
- resize-toggle
- arrange
- titlebar-toggle
- daemon (IPC & RPC) architecture, filesystem-free
- uses
fzf, so renders in the terminal - shows a floating window using
foot - dark mode support
checksgsettings get org.gnome.desktop.interface color-scheme - 1-hand keybindings for window switching
- mouse follows focus mode (optional)
- plain MRU list via
mru-listfor integrations
usage
- Start the daemon
sway-yasm daemon --default-keybindings - press:
alt+tab - term:
sway-yasm fzf switcher - term:
sway-yasm --help - see: default keybindings
help
$ sway-yasm --help
Usage:
sway-yasm [flags]
sway-yasm [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
config Change the config of a running daemon process
daemon Start tracking focus in sway
fzf Pure FZF versions of the switcher and pickers
help Help about any command
mru-list Print a list of MRU window IDs
path Show the +x files from PATH using foot
pick-clipboard Set the clipboard contents from the history
pick-space Show the workspace picker using foot
pick-win Show the window picker using foot
switcher Show the switcher window using foot
usr-cmd Run a user command with a specific name and optional args
win-to-space Move the current window to a specific workspace
Flags:
-h, --help help for sway-yasm
--version Print version and exit
Use "sway-yasm [command] --help" for more information about a command.
$ sway-yasm daemon --help
Start tracking focus in sway
Usage:
sway-yasm daemon [flags]
Flags:
--autoconfig Automatically configure the layout and start clipman (default true)
--default-keybindings Add default keybindings
-h, --help help for daemon
--mouse-follows-focus Calls 'input ... map_to_output OUTPUT' on each focus
keybindings
window switcher
Normal mode:
alt+tabshow the switcher, preselect the previous window, enterSwitchermode
Switcher mode:
spacefocus the selected window, close the switcherenterfocus the selected window, close the switchertabselect the next window in the listdownselect the next window in the listshift+tabselect the previous window in the listupselect the previous window in the listescclose the switcherctrl+cclose the switchera-z,0-9fuzzy search
Example - switch to the 3rd MRU window:
alt+tab(release)tabspace
Example - switch to Krusader by name:
alt+tab(release)k,r,uenter
default keybindings
Various ways to get the default keybindings.
$ sway-yasm daemon --default-keybindings
# shell swaymsg bindsym alt+tab exec sway-yasm switcher swaymsg bindsym mod4+o exec sway-yasm pick-space swaymsg bindsym mod4+p exec sway-yasm pick-win swaymsg bindsym mod4+d exec sway-yasm path swaymsg bbindsym mod4+alt+c exec sway-yasm clipboard
# config
bindsym alt+tab exec sway-yasm switcher
bindsym $mod+o exec sway-yasm pick-space
bindsym $mod+p exec sway-yasm pick-win
bindsym $mod+d exec sway-yasm path
bindsym $mod+alt+c exec sway-yasm clipboard
simulate blur events
# pass `container move to workspace number` via sway-yasm
# as IPC doesnt offer the blur event
bindsym $mod+Control+1 exec sway-yasm win-to-space 1
bindsym $mod+Control+2 exec sway-yasm win-to-space 2
bindsym $mod+Control+3 exec sway-yasm win-to-space 3
bindsym $mod+Control+4 exec sway-yasm win-to-space 4
bindsym $mod+Control+5 exec sway-yasm win-to-space 5
bindsym $mod+Control+6 exec sway-yasm win-to-space 6
bindsym $mod+Control+7 exec sway-yasm win-to-space 7
bindsym $mod+Control+8 exec sway-yasm win-to-space 8
bindsym $mod+Control+9 exec sway-yasm win-to-space 9
bindsym $mod+Control+0 exec sway-yasm win-to-space 10
mouse follows focus
$ sway-yasm daemon --mouse-follows-focus
Using input map_to_output, the daemon traps the relative cursor inside the currently focused output. Changing focus moves the cursor between outputs (thus the name). Useful for VNC screens on separate machines. When combined with waycorner, it creates a synergy-like effect.
Turning on/off:
$ sway-yasm config --mouse-follows-focus=false $ sway-yasm config --mouse-follows-focus=true
waycorner config example
# HEADLESS-1 (right screen) [pro5-left] enter_command = [ "sway-pointer-output", "2" ] locations = ["left"] [pro5-left.output] description = ".*output 1.*" # HEADLESS-2 (left screen) [mini6-right] enter_command = [ "sway-pointer-output", "1" ] locations = ["right"] [mini6-right.output] description = ".*output 2.*"
configuration
No yaml yet, but check headings of these files:
troubleshooting
env YASM_LOG=1 sway-yasm
development
./scripts/build.shenv YASM_LOG=1 YASM_DEBUG=1 ./sway-yasm deamonenv YASM_LOG=1 YASM_DEBUG=1 ./sway-yasm switcher
user command files
User command files provide a simple way to script sway using Go within the daemon, and can be fairly easily exchanged with others.
- resize-toggle
sway-yasm usr-cmd resize-toggle- resizes a split to 10/50/90%
- arrange
sway-yasm usr-cmd arrange- arranges windows to workspaces
- titlebar-toggle
sway-yasm usr-cmd titlebar-toggle- shows/hides window's titlebar
- next-vnc
sway-yasm usr-cmd next-vnc --back- focus the next VNC output with a connected client
Installing a user command file:
cp my-cmd.go pkg/usr-cmds
./scripts/build.sh
# run
./sway-yasm deamon
./sway-yasm usr-cmd my-cmd 123 -- -a --b=cModifying a user command file:
See pkg/usr-cmds/api.go for the API and pkg/usr-cmds/template.go for a sample usage.
nano pkg/usr-cmds/arrange.go
./scripts/build.sh
# run
./sway-yasm deamon
./sway-yasm usr-cmd arrangetodo
- key-value store for user commands
- yaml config file
- user scripts in wasm
- underscore windows from the current workspace
- show on all screens (via wayland)
- pick grouping containers with
pick-container switcher --current-output-onlyswitcher --current-space-onlyswitcher --group-by-output- tests (wink wink)
- themes
- reconnect logic
- refac the daaemon to asyncmachine
changelog
See CHANGELOG.md.









