2021-03-13 16:06:39 +00:00
|
|
|
#compdef riverctl
|
|
|
|
|
|
|
|
|
|
|
|
_riverctl() {
|
|
|
|
|
|
|
|
_next_prev() { _alternative 'arguments:args:(next previous)' }
|
|
|
|
_orientations() { _alternative 'arguments:args:(up down left right)' }
|
2021-03-16 15:16:06 +00:00
|
|
|
_hor_ver() { _alternative 'arguments:args:(horizontal vertical)' }
|
2021-03-13 16:06:39 +00:00
|
|
|
_attach() { _alternative 'arguments:args:(top bottom)' }
|
|
|
|
_focus_cursor() { _alternative 'arguments:args:(disabled normal strict)' }
|
|
|
|
_river_opts() { _alternative 'arguments:args:(-output -focused-output)' }
|
|
|
|
|
|
|
|
local -a _cmds
|
|
|
|
|
|
|
|
_cmds=(
|
|
|
|
# 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'
|
2021-04-26 19:03:04 +00:00
|
|
|
'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-03-13 16:06:39 +00: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'
|
|
|
|
# Mappings
|
|
|
|
'declare-mode:Create a new mode'
|
2021-03-16 15:16:06 +00:00
|
|
|
'enter-mode:Switch to given mode if it exists'
|
2021-03-13 16:06:39 +00:00
|
|
|
'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'
|
|
|
|
'unmap:Remove the mapping defined by the arguments'
|
|
|
|
'unmap-pointer:Remove the pointer mapping defined by the arguments'
|
|
|
|
# Configuration
|
|
|
|
'attach-mode:Configure where new views should attach to the view stack for the currently focused output'
|
|
|
|
'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'
|
|
|
|
'border-width:Set the border width to pixels'
|
2021-03-16 15:16:06 +00:00
|
|
|
'focus-follows-cursor:Configure the focus behavior when moving cursor'
|
2021-03-13 16:06:39 +00:00
|
|
|
'opacity:Configure server-side opacity of views'
|
2021-03-16 15:16:06 +00:00
|
|
|
'set-repeat:Set the keyboard repeat rate and repeat delay'
|
2021-03-13 16:06:39 +00:00
|
|
|
'xcursor-theme:Set the xcursor theme'
|
|
|
|
)
|
|
|
|
|
|
|
|
local -A opt_args
|
|
|
|
|
|
|
|
_arguments -C '*:: :->_cmds'
|
|
|
|
|
|
|
|
if (( CURRENT == 1 )); then
|
|
|
|
_describe -t commands "commands" _cmds
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$words[1]" in
|
|
|
|
focus-output) _next_prev ;;
|
|
|
|
focus-view) _next_prev ;;
|
|
|
|
move) _orientations ;;
|
|
|
|
resize) _hor_ver ;;
|
|
|
|
snap) _orientations ;;
|
|
|
|
send-to-output) _next_prev ;;
|
|
|
|
swap) _next_prev ;;
|
|
|
|
map) _alternative 'arguments:optional:(-release)' ;;
|
|
|
|
unmap) _alternative 'arguments:optional:(-release)' ;;
|
|
|
|
attach-mode) _attach ;;
|
|
|
|
focus-follows-cursor) _focus_cursor ;;
|
|
|
|
get-option) _river_opts ;;
|
|
|
|
set-option) _river_opts ;;
|
2021-04-14 22:28:39 +00:00
|
|
|
unset-option) _river_opts ;;
|
2021-03-13 16:06:39 +00:00
|
|
|
mod-option) _river_opts ;;
|
|
|
|
*) return 0 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
return 1
|
|
|
|
}
|