2018-07-27 17:31:18 +02:00
|
|
|
# swaymsg(1) completion
|
|
|
|
|
|
|
|
_swaymsg()
|
|
|
|
{
|
2022-03-27 10:50:12 +02:00
|
|
|
local cur prev types short long
|
2018-07-27 17:31:18 +02:00
|
|
|
_get_comp_words_by_ref cur prev
|
|
|
|
|
|
|
|
types=(
|
|
|
|
'get_workspaces'
|
|
|
|
'get_seats'
|
|
|
|
'get_inputs'
|
|
|
|
'get_outputs'
|
|
|
|
'get_tree'
|
|
|
|
'get_marks'
|
|
|
|
'get_bar_config'
|
|
|
|
'get_version'
|
2018-07-18 12:52:29 +02:00
|
|
|
'get_binding_modes'
|
2020-06-13 05:32:24 +02:00
|
|
|
'get_binding_state'
|
2018-07-18 12:52:29 +02:00
|
|
|
'get_config'
|
2018-07-18 13:30:39 +02:00
|
|
|
'send_tick'
|
2019-03-08 20:39:35 +01:00
|
|
|
'subscribe'
|
2018-07-27 17:31:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
short=(
|
|
|
|
-h
|
2019-03-08 20:39:35 +01:00
|
|
|
-m
|
2019-03-08 18:43:04 +01:00
|
|
|
-p
|
2018-07-27 17:31:18 +02:00
|
|
|
-q
|
|
|
|
-r
|
|
|
|
-s
|
|
|
|
-t
|
|
|
|
-v
|
|
|
|
)
|
|
|
|
|
|
|
|
long=(
|
|
|
|
--help
|
2019-03-08 20:39:35 +01:00
|
|
|
--monitor
|
2019-03-08 18:43:04 +01:00
|
|
|
--pretty
|
2018-07-27 17:31:18 +02:00
|
|
|
--quiet
|
|
|
|
--raw
|
|
|
|
--socket
|
|
|
|
--type
|
2020-05-15 12:48:39 +02:00
|
|
|
--version
|
2018-07-27 17:31:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
case $prev in
|
|
|
|
-s|--socket)
|
|
|
|
_filedir
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-t|--type)
|
|
|
|
COMPREPLY=($(compgen -W "${types[*]}" -- "$cur"))
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ $cur == --* ]]; then
|
|
|
|
COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
|
|
|
|
else
|
|
|
|
COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
|
|
|
|
COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
|
|
|
|
fi
|
|
|
|
|
|
|
|
} &&
|
|
|
|
complete -F _swaymsg swaymsg
|