Skip to content

Your compositor

github-actions[bot] edited this page Dec 5, 2026 · 1 revision

Your compositor

alpheus reads the workspaces and the windows from the compositor you run (Hyprland, niri, Sway or Mango). Two things it does not do itself: switching to a workspace when you click or scroll on one, and focusing a window you chose in the launcher. It runs a command for each.

Which commands

By default both are wm-set, a script that alpheus does not ship: write one for your compositor, or point the keys at your own tools, as below. What each call must do, and what the two opaque values look like on each compositor, is in the table of External commands. Without a working command the bar still shows the workspaces and the launcher still lists the windows, but clicking them does nothing.

Switching workspaces

# ~/.config/alpheus/bar.toml
# Switch workspaces on Sway directly, without a wm-set script.
[workspaces]
command = ["sh", "-c", 'case "$1" in name:*) swaymsg workspace "${1#name:}";; *) swaymsg workspace number "$1";; esac', "workspace", "{workspace}"]

{workspace} is replaced by the compositor's reference for the workspace: on Sway a number, or name:<name> for a workspace without one, which is why the script handles both. {output} is also available, and this Sway command does not use it. The named-workspace branch hands the raw name to swaymsg's own parser, so a name containing ;, or one called next or prev, misbehaves.

Focusing a window

# ~/.config/alpheus/launcher.toml
# Focus the window chosen in the launcher's windows mode, on Sway.
focus = ["sh", "-c", 'swaymsg "[con_id=${1#id:}] focus"', "focus-window", "{window}"]

{window} is id:<con id> on Sway. Some argument of the command must contain {window} (it need not be the whole argument: --window={window} is accepted), and the program itself (here sh) may not. On Hyprland it is address:0x… and on niri and Mango id:N, so the command changes with the compositor.

On Mango the workspace reference is the tag index (1, 2, ...) and the window selector is id:<client id>; write the command with Mango's own tools, handing those values back.

Both examples run a small shell script through sh -c; alpheus itself never uses a shell. The trailing "workspace" and "focus-window" become $0 for the script, so the value is $1.

Applying it

[workspaces] is in bar.toml, read once: restart alpheus-demon (see Getting started). focus is in launcher.toml, read at each open of the launcher: nothing to restart.

If it does not work

A command or focus that is empty, or a focus without {window}, makes the whole file invalid, with a warning in the daemon's standard error (bar.toml then falls back to its defaults whole; the launcher still opens with its defaults). A command that is valid but whose program is missing logs a line or reports it in the UI, and does nothing else. Run the command by hand with a made-up value to see what it does.

Reference: External commands, [workspaces].

Clone this wiki locally