bspwm/contrib/bash_completion

30 lines
1.2 KiB
Bash
Raw Normal View History

2013-08-16 11:59:09 +02:00
_bspc() {
2017-07-16 21:33:20 +02:00
local commands='node desktop monitor query rule wm subscribe config quit'
2013-05-06 14:52:18 +02:00
local settings='external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity directional_focus_tightness borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor ignore_ewmh_focus center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
2013-05-06 14:52:18 +02:00
2014-01-21 20:51:02 +01:00
COMPREPLY=()
2013-05-06 14:52:18 +02:00
2014-01-21 20:51:02 +01:00
if [[ $COMP_CWORD -ge 1 ]] ; then
local current_word="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "$commands" -- "$current_word") )
return 0
else
local second_word=${COMP_WORDS[1]}
case $second_word in
config)
if [[ $COMP_CWORD -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "$settings" -- "$current_word") )
return 0
fi
;;
esac
fi
fi
2013-05-06 14:52:18 +02:00
}
complete -F _bspc bspc
# vim: set ft=sh: