Sway Integration
Key binding
Section titled “Key binding”set $super Mod4bindsym $super+Space exec raffiInside sway, Raffi starts the app you pick with swaymsg exec, so sway is its
parent and the app gets sway’s environment and working directory. Command
lines that sway would split or expand (with ;, ,, $, quotes, backslashes
or line breaks) are started by Raffi itself. To always start apps from Raffi,
set launch: direct in general (see
General Settings).
Window rule
Section titled “Window rule”Raffi’s window has the app ID com.chmouel.raffi. To float it in the middle
of the screen without a border:
for_window [app_id="com.chmouel.raffi"] floating enable, border none, resize set width 45 ppt height 78 ppt, move position centerPut this in the config file. Sent through swaymsg, the commands after the
first comma run on their own and fail.
If you start a second style with raffi --app-name com.chmouel.raffi.fb, give
it its own for_window line with that app ID.
Binding addons
Section titled “Binding addons”Pass an addon keyword as the initial query to open Raffi straight into it:
bindsym $super+w exec raffi -i "win "bindsym $super+v exec raffi -i "clip "bindsym $super+t exec raffi -i "tabs "Window switcher
Section titled “Window switcher”win lists the open windows, scratchpad included. Enter focuses one,
Ctrl+Enter moves it to the current workspace, Ctrl+D closes it, and Ctrl+Tab
shows the workspaces instead. The list follows sway’s window and workspace
events while it is open. See Window Switcher.
Focus a running app
Section titled “Focus a running app”With raise_running: true in general, Enter on a launcher whose app already
has a window focuses that window, and Ctrl+Enter starts a new one. Raffi
matches the app ID, or the class of an Xwayland window. See
General Settings.
Sway-only launchers
Section titled “Sway-only launchers”ifcompositor shows a launcher only under the given compositors:
sway-reload: binary: swaymsg args: ["reload"] description: "Reload sway" ifcompositor: swayTransparency and blur
Section titled “Transparency and blur”Raffi is translucent by default (opacity: 0.95 in general). Plain
Sway has no blur. SwayFX can blur
behind it:
for_window [app_id="com.chmouel.raffi"] blur enablePrint-only mode
Section titled “Print-only mode”raffi -p prints the selected command instead of running it. You can hand it
to swaymsg yourself:
set $menu raffi -pbindsym $super+Space exec cmd=$($menu) && [ -n "$cmd" ] && swaymsg exec -- "$cmd"[ -n "$cmd" ] skips swaymsg when nothing was picked, and the quotes pass
the command as one argument, which keeps arguments with spaces and multi-line
script entries intact.
Troubleshooting
Section titled “Troubleshooting”Raffi doesn’t appear
Section titled “Raffi doesn’t appear”- Check that Raffi is in sway’s
PATH. Sway’sexecruns commands throughsh -c, which does not read~/.bashrcor~/.zshrc, so a binary in~/.cargo/bincan work in a terminal but not from a binding. Use an absolute path, or export the directory withsystemctl --user import-environment PATH. - Check sway’s logs:
journalctl --user -u sway.
An app starts with the wrong environment or directory
Section titled “An app starts with the wrong environment or directory”Apps started through sway inherit sway’s environment, not your shell’s. Set
launch: direct to have Raffi start them, or export the variables to sway.
Invalid exec command (expected at least 1 argument, got 0)
Section titled “Invalid exec command (expected at least 1 argument, got 0)”This comes from swaymsg in the print-only recipe: Raffi printed nothing
because you closed it or picked an addon result, which acts inside Raffi.
Keep the [ -n "$cmd" ] guard.
Debugging
Section titled “Debugging”Write a debug log from the binding:
bindsym $super+Space exec raffi --debug-file /tmp/raffi.log