summaryrefslogtreecommitdiffstats
path: root/completions/bash/swaymsg
diff options
context:
space:
mode:
Diffstat (limited to 'completions/bash/swaymsg')
-rw-r--r--completions/bash/swaymsg59
1 files changed, 59 insertions, 0 deletions
diff --git a/completions/bash/swaymsg b/completions/bash/swaymsg
new file mode 100644
index 00000000..20092bdc
--- /dev/null
+++ b/completions/bash/swaymsg
@@ -0,0 +1,59 @@
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_binding_modes'
18 'get_config'
19 'send_tick'
20 )
21
22 short=(
23 -h
24 -q
25 -r
26 -s
27 -t
28 -v
29 )
30
31 long=(
32 --help
33 --quiet
34 --raw
35 --socket
36 --type
37 --verbose
38 )
39
40 case $prev in
41 -s|--socket)
42 _filedir
43 return
44 ;;
45 -t|--type)
46 COMPREPLY=($(compgen -W "${types[*]}" -- "$cur"))
47 return
48 ;;
49 esac
50
51 if [[ $cur == --* ]]; then
52 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
53 else
54 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
55 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
56 fi
57
58} &&
59complete -F _swaymsg swaymsg