table of contents
RIVERCTL(1) | General Commands Manual | RIVERCTL(1) |
NAME¶
riverctl - command-line interface for controlling river
SYNOPSIS¶
riverctl [options] command [command specific arguments]
DESCRIPTION¶
riverctl is a command-line utility used to control and configure river over the Wayland protocol.
OPTIONS¶
-h
-version
TERMINOLOGY¶
This manual uses terms that some may find confusing, coming mostly from their usage among other Wayland projects.
The compositor, display server, Wayland server etc. are ways to refer to river itself.
A view (or toplevel) is what most call a window.
An output is a synonym for a screen or monitor.
Tags are river's way of dividing views of an output into groups (not necessarily disjunct), an analogy to workspaces.
COMMANDS¶
ACTIONS¶
close
exit
focus-output next|previous|up|right|down|left|name
focus-view [-skip-floating] next|previous|up|down|left|right
- •
- -skip-floating: Skip floating views, only focusing tiled ones.
move up|down|left|right delta
resize horizontal|vertical delta
snap up|down|left|right
send-to-output [-current-tags] next|previous|up|right|down|left|name
- •
- -current-tags: Assign the currently focused tags of the destination output to the view.
spawn shell_command
swap next|previous|up|down|left|right
toggle-float
toggle-fullscreen
zoom
default-layout namespace
output-layout namespace
send-layout-cmd namespace command
TAG MANAGEMENT¶
Tags are similar to workspaces but more flexible. You can assign views multiple tags and focus multiple tags simultaneously. Bitfields are used to describe sets of tags when interfacing with river. As such, the following commands take a normal base 10 number as their argument but the semantics are best understood in binary. The binary number 000000001 represents a set containing only tag 1 while 100001101 represents a set containing tags 1, 3, 4, and 9.
When a view spawns it is assigned the currently focused tags of the output.
At least one tag must always be focused and each view must be assigned at least one tag. Operations that would violate either of these requirements are ignored by river.
set-focused-tags tags
set-view-tags tags
toggle-focused-tags tags
toggle-view-tags tags
spawn-tagmask tagmask
focus-previous-tags
send-to-previous-tags
MAPPINGS¶
Mappings are modal in river. Each mapping is associated with a mode and is only active while in that mode. There are two special modes: "normal" and "locked". The normal mode is the initial mode on startup. The locked mode is automatically entered while the session is locked (e.g. due to a screenlocker). It cannot be entered or exited manually.
The following modifiers are available for use in mappings:
- Shift
- Control
- Mod1 (Alt)
- Mod3
- Mod4 (Super)
- Mod5
- None
Alt and Super are aliases for Mod1 and Mod4 respectively. None allows creating a mapping without modifiers.
Keys are specified by their XKB keysym name. See /usr/include/xkbcommon/xkbcommon-keysyms.h for the complete list.
Mouse buttons are specified by Linux input event code names. The most commonly used values are:
- BTN_LEFT - left mouse button
- BTN_RIGHT - right mouse button
- BTN_MIDDLE - middle mouse button
A complete list may be found in /usr/include/linux/input-event-codes.h
declare-mode name
enter-mode name
map [-release|-repeat|-layout index] mode modifiers key command
- -release: if passed activate on key release instead of key press
- -repeat: if passed activate repeatedly until key release; may not be used with -release
- -layout: if passed, a specific layout is pinned to the mapping. When the mapping is checked against a pressed key, this layout is used to translate the key independent of the active layout
- •
- index: zero-based index of a layout set with the keyboard-layout command. If the index is out of range, the -layout option will have no effect
- mode: name of the mode for which to create the mapping
- modifiers: one or more of the modifiers listed above, separated by a plus sign (+).
- key: an XKB keysym name as described above
- command: any command that may be run with riverctl
map-pointer mode modifiers button action|command
- mode: name of the mode for which to create the mapping
- modifiers: one or more of the modifiers listed above, separated by a plus sign (+).
- button: the name of a Linux input event code as described above
- action: one of the following values:
- move-view
- resize-view
- •
- command: any command that may be run with riverctl
map-switch mode lid|tablet state command
- mode: name of the mode for which to create the mapping
- lid|tablet: 'lid switch' and 'tablet mode switch' are supported
- state:
- •
- possible states for lid:
- close
- open
- •
- possible states for tablet:
- on
- off
- •
- command: any command that may be run with riverctl
unmap [-release] mode modifiers key
- -release: if passed unmap the key release instead of the key press
- mode: name of the mode for which to remove the mapping
- modifiers: one or more of the modifiers listed above, separated by a plus sign (+).
- key: an XKB keysym name as described above
unmap-pointer mode modifiers button
- mode: name of the mode for which to remove the mapping
- modifiers: one or more of the modifiers listed above, separated by a plus sign (+).
- button: the name of a Linux input event code as described above
unmap-switch mode lid|tablet state
- mode: name of the mode for which to remove the mapping
- lid|tablet: the switch for which to remove the mapping
- state: a state as listed above
RULES¶
Rules match the app-id and title of views against a glob pattern. A glob is a string that may optionally have an * at the beginning and/or end. An * in a glob matches zero or more arbitrary characters in the app-id or title.
For example, abc is matched by a*, *a*, *b*, *c, abc, and * but not matched by *a, b*, *b, c*, or ab. Note that * matches everything while ** and the empty string are invalid.
rule-add [-app-id glob|-title glob] action [arguments]
The supported action types are:
- float: Make the view floating. Applies only to new views.
- no-float: Don't make the view floating. Applies only to new views.
- ssd: Use server-side decorations for the view. Applies to new and existing views.
- csd: Use client-side decorations for the view. Applies to new and existing views.
- tags: Set the initial tags of the view. Requires the tags as an argument. Applies only to new views.
- output: Set the initial output of the view. Requires the output as an argument. Applies only to new views. The output can be specified either by connector name (such as HDMI-A-1, or DP-2), or by identifier in the form of MAKE MODEL SERIAL, for example for an output with make: HP Inc., model: HP 22w, and serial: CNC93720WF, the identifier would be: HP Inc. HP 22w CNC93720WF. If the make, model, or serial is unknown, the word "Unknown" is used instead.
- position: Set the initial position of the view, clamping to the bounds of the output. Requires x and y coordinates of the view as arguments, both of which must be non-negative. Applies only to new views.
- dimensions: Set the initial dimensions of the view, clamping to the constraints of the view. Requires width and height of the view as arguments, both of which must be non-negative. Applies only to new views.
- fullscreen: Make the view fullscreen. Applies only to new views.
- no-fullscreen: Don't make the view fullscreen. Applies only to new views.
Both float and no-float rules are added to the same list, which means that adding a no-float rule with the same arguments as a float rule will overwrite it. The same holds for ssd and csd, fullscreen and no-fullscreen rules.
If multiple rules in a list match a given view the most specific rule will be applied. For example with the following rules
app-id title action foo bar ssd foo * csd * bar csd * baz ssd
If a view is not matched by any rule, river will respect the csd/ssd wishes of the client and may start the view floating based on simple heuristics intended to catch popup-like views.
If a view is started fullscreen or is not floating, then position and dimensions rules will have no effect A view must be matched by a float rule in order for them to take effect.
rule-del [-app-id glob|-title glob] action
list-rules float|ssd|tags|position|dimensions|fullscreen
CONFIGURATION¶
default-attach-mode top|bottom|above|below|after <N>
Possible values:
- top: Prepends the newly spawned view at the top of the stack.
- bottom: Appends the newly spawned view at the bottom of the stack.
- above: Inserts the newly spawned view above the currently focused view.
- below: Inserts the newly spawned view below the currently focused view.
- after <N>: Inserts the newly spawned view after N views in the stack.
Note that the deprecated attach-mode command is aliased to default-attach-mode for backwards compatibility.
output-attach-mode top|bottom|above|below|after <N>
background-color 0xRRGGBB|0xRRGGBBAA
border-color-focused 0xRRGGBB|0xRRGGBBAA
border-color-unfocused 0xRRGGBB|0xRRGGBBAA
border-color-urgent 0xRRGGBB|0xRRGGBBAA
border-width pixels
focus-follows-cursor disabled|normal|always
- disabled: Moving the cursor does not affect focus. This is the default.
- normal: Moving the cursor over a view will focus that view. Moving the cursor within a view will not re-focus that view if focus has moved elsewhere.
- always: Moving the cursor will always focus whatever view is under the cursor.
If the view to be focused is on an output that does not have focus, focus is switched to that output.
hide-cursor timeout timeout
hide-cursor when-typing enabled|disabled
set-cursor-warp disabled|on-output-change|on-focus-change
- disabled: Cursor will not be warped. This is the default.
- on-output-change: When a different output is focused, the cursor will be warped to its center.
- on-focus-change: When a different view/output is focused, the cursor will be warped to its center.
set-repeat rate delay
xcursor-theme theme_name [size]
INPUT CONFIGURATION¶
list-inputs
list-input-configs
keyboard-layout [-rules rules] [-model model] [-variant variant] [-options options] layout
keyboard-layout-file path
keyboard-group-create group_name
keyboard-group-destroy group_name
keyboard-group-add group_name input_device_name
keyboard-group-remove group_name input_device_name
The input command can be used to create a configuration rule for an input device identified by its name. The name of an input device consists of its type, its numerical vendor id, its numerical product id and finally its self-advertised name, separated by -. Simple globbing patterns are supported, see the rules section for further information on globs.
A list of all device properties that can be configured may be found below. However note that not every input device supports every property.
input name events enabled|disabled|disabled-on-external-mouse
input name accel-profile none|flat|adaptive
input name pointer-accel factor
input name click-method none|button-areas|clickfinger
input name drag enabled|disabled
input name drag-lock enabled|disabled
input name disable-while-typing enabled|disabled
input name disable-while-trackpointing enabled|disabled
input name middle-emulation enabled|disabled
input name natural-scroll enabled|disabled
input name scroll-factor factor
input name left-handed enabled|disabled
input name tap enabled|disabled
input name tap-button-map left-right-middle|left-middle-right
- left-right-middle: 1 finger tap equals left click, 2 finger tap equals right click, 3 finger tap equals middle click.
- left-middle-right: 1 finger tap equals left click, 2 finger tap equals middle click, 3 finger tap equals right click.
input name scroll-method none|two-finger|edge|button
- none: No scrolling
- two-finger: Scroll by swiping with two fingers simultaneously
- edge: Scroll by swiping along the edge
- button: Scroll with pointer movement while holding down a button
input name scroll-button button
input name map-to-output output|disabled
EXAMPLES¶
Bind Super+Return in normal mode to spawn a foot(1) terminal:
Bind Super+Shift+J to swap the focused view with the next visible view:
AUTHORS¶
Maintained by Isaac Freund <mail@isaacfreund.com> who is assisted by open source contributors. For more information about river's development, see <https://isaacfreund.com/software/river>.
SEE ALSO¶
2024-09-24 |