bspwm/bash_completion

30 lines
1.1 KiB
Bash
Raw Normal View History

2013-08-16 11:59:09 +02:00
_bspc() {
local commands='window desktop monitor query pointer rule restore control config quit'
2013-05-06 14:52:18 +02:00
local settings='focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color urgent_border_color border_width window_gap split_ratio wm_name borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor adaptative_raise apply_shadow_property auto_alternate auto_cancel history_aware_focus'
2013-05-06 14:52:18 +02:00
COMPREPLY=()
if [[ $COMP_CWORD -ge 1 ]] ; then
local current_word="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD -eq 1 ]] ; then
2013-08-16 11:59:09 +02:00
COMPREPLY=( $(compgen -W "$commands" -- "$current_word") )
2013-05-06 14:52:18 +02:00
return 0
else
local second_word=${COMP_WORDS[1]}
case $second_word in
config)
2013-05-06 14:52:18 +02:00
if [[ $COMP_CWORD -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "$settings" -- "$current_word") )
2013-08-16 11:59:09 +02:00
return 0
2013-05-06 14:52:18 +02:00
fi
;;
esac
fi
fi
}
complete -F _bspc bspc
# vim: set ft=sh: