swayfx/completions/bash/swaymsg

66 lines
952 B
Plaintext
Raw Normal View History

2018-07-28 01:31:18 +10:00
# swaymsg(1) completion
_swaymsg()
{
2022-04-28 07:33:23 +10:00
local cur prev types short long
2018-07-28 01:31:18 +10: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 20:52:29 +10:00
'get_binding_modes'
'get_binding_state'
2018-07-18 20:52:29 +10:00
'get_config'
2018-07-18 21:30:39 +10:00
'send_tick'
'subscribe'
2018-07-28 01:31:18 +10:00
)
short=(
-h
-m
-p
2018-07-28 01:31:18 +10:00
-q
-r
-s
-t
-v
)
long=(
--help
--monitor
--pretty
2018-07-28 01:31:18 +10:00
--quiet
--raw
--socket
--type
--version
2018-07-28 01:31:18 +10: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