2021-03-13 08:06:39 -08:00
|
|
|
#compdef riverctl
|
2021-06-14 03:26:59 -07:00
|
|
|
#
|
2021-11-01 03:28:43 -07:00
|
|
|
# Completion script for riverctl, part of river <https://github.com/riverwm/river>
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
_riverctl_subcommands()
|
|
|
|
{
|
|
|
|
local -a riverctl_subcommands
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
riverctl_subcommands=(
|
|
|
|
# Actions
|
|
|
|
'close:Close the focused view'
|
|
|
|
'csd-filter-add:Add app-id to the CSD filter list'
|
|
|
|
'exit:Exit the compositor, terminating the Wayland session'
|
|
|
|
'float-filter-add:Add app-id to the float filter list'
|
|
|
|
'focus-output:Focus the next or previous output'
|
|
|
|
'focus-view:Focus the next or previous view in the stack'
|
|
|
|
'move:Move the focused view in the specified direction'
|
|
|
|
'resize:Resize the focused view along the given axis'
|
|
|
|
'snap:Snap the focused view to the specified screen edge'
|
|
|
|
'send-to-output:Send the focused view to the next or the previous output'
|
|
|
|
'spawn:Run shell_command using /bin/sh -c'
|
|
|
|
'swap:Swap the focused view with the next/previous visible non-floating view'
|
|
|
|
'toggle-float:Toggle the floating state of the focused view'
|
|
|
|
'toggle-fullscreen:Toggle the fullscreen state of the focused view'
|
|
|
|
'zoom:Bump the focused view to the top of the layout stack'
|
|
|
|
'default-layout:Set the layout namespace to be used by all outputs by default.'
|
|
|
|
'output-layout:Set the layout namespace of currently focused output.'
|
2021-10-31 14:32:59 -07:00
|
|
|
'send-layout-cmd:Send command to the layout generator on the currently focused output with matching namespace'
|
2021-06-14 03:26:59 -07:00
|
|
|
# Tag management
|
|
|
|
'set-focused-tags:Show views with tags corresponding to the set bits of tags'
|
|
|
|
'set-view-tags:Assign the currently focused view the tags corresponding to the set bits of tags'
|
|
|
|
'toggle-focused-tags:Toggle visibility of views with tags corresponding to the set bits of tags'
|
|
|
|
'toggle-view-tags:Toggle the tags of the currently focused view'
|
|
|
|
'spawn-tagmask:Set a tagmask to filter the tags assigned to newly spawned views on the focused output'
|
2021-07-06 23:51:00 -07:00
|
|
|
'focus-previous-tags:Sets tags to their previous value on the focused output'
|
2021-09-11 13:21:48 -07:00
|
|
|
'send-to-previous-tags:Assign the currently focused view the previous tags of the focused output'
|
2021-06-14 03:26:59 -07:00
|
|
|
# Mappings
|
|
|
|
'declare-mode:Create a new mode'
|
|
|
|
'enter-mode:Switch to given mode if it exists'
|
|
|
|
'map:Run command when key is pressed while modifiers are held down and in the specified mode'
|
|
|
|
'map-pointer:Move or resize views when button and modifiers are held down while in the specified mode'
|
2022-02-07 05:51:23 -08:00
|
|
|
'map-switch:Run command when river receives a switch event in the specified mode'
|
2021-06-14 03:26:59 -07:00
|
|
|
'unmap:Remove the mapping defined by the arguments'
|
|
|
|
'unmap-pointer:Remove the pointer mapping defined by the arguments'
|
2022-02-07 05:51:23 -08:00
|
|
|
'unmap-switch:Remove the switch mapping defined by the arguments'
|
2021-06-14 03:26:59 -07:00
|
|
|
# Configuration
|
|
|
|
'attach-mode:Configure where new views should attach to the view stack'
|
|
|
|
'background-color:Set the background color'
|
|
|
|
'border-color-focused:Set the border color of focused views'
|
|
|
|
'border-color-unfocused:Set the border color of unfocused views'
|
2021-08-12 07:16:23 -07:00
|
|
|
'border-color-urgent:Set the border color of urgent views'
|
2021-06-14 03:26:59 -07:00
|
|
|
'border-width:Set the border width to pixels'
|
|
|
|
'focus-follows-cursor:Configure the focus behavior when moving cursor'
|
|
|
|
'set-repeat:Set the keyboard repeat rate and repeat delay'
|
2021-06-26 10:00:16 -07:00
|
|
|
'set-cursor-warp:Set the cursor warp mode.'
|
2021-06-14 03:26:59 -07:00
|
|
|
'xcursor-theme:Set the xcursor theme'
|
|
|
|
# Input
|
|
|
|
'input:Configure input devices'
|
|
|
|
'list-inputs:List all input devices'
|
|
|
|
'list-input-configs:List all input configurations'
|
|
|
|
)
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
_describe -t command 'command' riverctl_subcommands
|
|
|
|
}
|
|
|
|
|
|
|
|
_riverctl_input_subcommands()
|
|
|
|
{
|
|
|
|
local -a input_subcommands
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
input_subcommands=(
|
|
|
|
'events:Configure whether the input devices events will be used by river'
|
|
|
|
'accel-profile:Set the pointer acceleration profile'
|
|
|
|
'pointer-accel:Set the pointer acceleration factor'
|
|
|
|
'click-method:Set the click method'
|
|
|
|
'drag:Enable or disable the tap-and-drag functionality'
|
|
|
|
'drag-lock:Enable or disable the drag lock functionality'
|
|
|
|
'disable-while-typing:Enable or disable the disable-while-typing functionality'
|
|
|
|
'middle-emulation:Enable or disable the middle click emulation functionality'
|
|
|
|
'natural-scroll:Enable or disable the natural scroll functionality'
|
|
|
|
'left-handed:Enable or disable the left handed mode'
|
|
|
|
'tap:Enable or disable the tap functionality'
|
|
|
|
'tap-button-map:Configure the button mapping for tapping'
|
|
|
|
'scroll-method:Set the scroll method'
|
|
|
|
'scroll-button:Set the scroll button'
|
|
|
|
)
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
_describe -t command 'command' input_subcommands
|
|
|
|
}
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
_riverctl_input()
|
|
|
|
{
|
|
|
|
local state
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
_arguments \
|
|
|
|
'1: :->commands' \
|
|
|
|
'*:: :->args'
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
case $state in
|
|
|
|
commands) _alternative 'common-commands:common:_riverctl_input_subcommands' ;;
|
|
|
|
args)
|
|
|
|
case "$words[1]" in
|
|
|
|
events) _alternative 'input-cmds:args:(enabled disabled disabled-on-external-mouse)' ;;
|
|
|
|
accel-profile) _alternative 'input-cmds:args:(none flat adaptive)' ;;
|
|
|
|
click-method) _alternative 'input-cmds:args:(none button-area clickfinger)' ;;
|
|
|
|
drag) _alternative 'input-cmds:args:(enabled disabled)' ;;
|
|
|
|
drag-lock) _alternative 'input-cmds:args:(enabled disabled)' ;;
|
|
|
|
disable-while-typing) _alternative 'input-cmds:args:(enabled disabled)' ;;
|
|
|
|
middle-emulation) _alternative 'input-cmds:args:(enabled disabled)' ;;
|
|
|
|
natural-scroll) _alternative 'input-cmds:args:(enabled disabled)' ;;
|
|
|
|
left-handed) _alternative 'input-cmds:args:(enabled disabled)' ;;
|
|
|
|
tap) _alternative 'input-cmds:args:(enabled disabled)' ;;
|
|
|
|
tap-button-map) _alternative 'input-cmds:args:(left-right-middle left-middle-right)' ;;
|
|
|
|
scroll-method) _alternative 'input-cmds:args:(none two-finger edge button)' ;;
|
|
|
|
*) return 0 ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
_riverctl()
|
|
|
|
{
|
|
|
|
local state
|
2021-03-13 08:06:39 -08:00
|
|
|
|
2021-06-14 03:26:59 -07:00
|
|
|
_arguments \
|
|
|
|
'1: :->commands' \
|
|
|
|
'*:: :->args'
|
|
|
|
|
|
|
|
case $state in
|
|
|
|
commands) _alternative 'common-commands:common:_riverctl_subcommands' ;;
|
|
|
|
args)
|
|
|
|
case "$words[1]" in
|
|
|
|
focus-output) _alternative 'arguments:args:(next previous)' ;;
|
|
|
|
focus-view) _alternative 'arguments:args:(next previous)' ;;
|
|
|
|
input) _riverctl_input ;;
|
|
|
|
move) _alternative 'arguments:args:(up down left right)' ;;
|
|
|
|
resize) _alternative 'arguments:args:(horizontal vertical)' ;;
|
|
|
|
snap) _alternative 'arguments:args:(up down left right)' ;;
|
|
|
|
send-to-output) _alternative 'arguments:args:(next previous)' ;;
|
|
|
|
swap) _alternative 'arguments:args:(next previous)' ;;
|
2021-08-15 05:49:11 -07:00
|
|
|
map) _alternative 'arguments:optional:(-release -repeat)' ;;
|
2021-06-14 03:26:59 -07:00
|
|
|
unmap) _alternative 'arguments:optional:(-release)' ;;
|
|
|
|
attach-mode) _alternative 'arguments:args:(top bottom)' ;;
|
2021-07-29 09:57:55 -07:00
|
|
|
focus-follows-cursor) _alternative 'arguments:args:(disabled normal)' ;;
|
2021-06-26 10:00:16 -07:00
|
|
|
set-cursor-warp) _alternative 'arguments:args:(disabled on-output-change)' ;;
|
2021-06-14 03:26:59 -07:00
|
|
|
*) return 0 ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
2021-03-13 08:06:39 -08:00
|
|
|
}
|
2021-06-14 03:26:59 -07:00
|
|
|
|
|
|
|
_riverctl "$@"
|