aboutsummaryrefslogtreecommitdiffstats
path: root/completions
diff options
context:
space:
mode:
authorLibravatar Eric Engestrom <eric.engestrom@intel.com>2018-07-27 16:31:18 +0100
committerLibravatar Eric Engestrom <eric.engestrom@intel.com>2018-07-30 15:56:15 +0100
commit21609f8af26b51872ef045ec75cb543835961ead (patch)
treeb6177cca19310ff6b50432f879392a023e7e05a6 /completions
parentbash: add completion for sway (diff)
downloadsway-21609f8af26b51872ef045ec75cb543835961ead.tar.gz
sway-21609f8af26b51872ef045ec75cb543835961ead.tar.zst
sway-21609f8af26b51872ef045ec75cb543835961ead.zip
bash: add completion for swaymsg
Diffstat (limited to 'completions')
-rw-r--r--completions/bash/swaymsg57
1 files changed, 57 insertions, 0 deletions
diff --git a/completions/bash/swaymsg b/completions/bash/swaymsg
new file mode 100644
index 00000000..8ec90b6f
--- /dev/null
+++ b/completions/bash/swaymsg
@@ -0,0 +1,57 @@
1# swaymsg(1) completion
2
3_swaymsg()
4{
5 local cur prev
6 _get_comp_words_by_ref cur prev
7
8 types=(
9 'get_workspaces'
10 'get_seats'
11 'get_inputs'
12 'get_outputs'
13 'get_tree'
14 'get_marks'
15 'get_bar_config'
16 'get_version'
17 'get_clipboard'
18 )
19
20 short=(
21 -h
22 -q
23 -r
24 -s
25 -t
26 -v
27 )
28
29 long=(
30 --help
31 --quiet
32 --raw
33 --socket
34 --type
35 --verbose
36 )
37
38 case $prev in
39 -s|--socket)
40 _filedir
41 return
42 ;;
43 -t|--type)
44 COMPREPLY=($(compgen -W "${types[*]}" -- "$cur"))
45 return
46 ;;
47 esac
48
49 if [[ $cur == --* ]]; then
50 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
51 else
52 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
53 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
54 fi
55
56} &&
57complete -F _swaymsg swaymsg