summaryrefslogtreecommitdiffstats
path: root/completions
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-08-02 23:49:25 +0100
committerLibravatar GitHub <noreply@github.com>2018-08-02 23:49:25 +0100
commit3a54e2291c017397ceff60511c29fe70d229bc8b (patch)
treed340b7776f945462f5ecffc830ada4d5fbe82f51 /completions
parentEnable wlr-gamma-control-unstable-v1 (diff)
parentMerge pull request #2411 from emersion/fullscreen-pointer-input (diff)
downloadsway-3a54e2291c017397ceff60511c29fe70d229bc8b.tar.gz
sway-3a54e2291c017397ceff60511c29fe70d229bc8b.tar.zst
sway-3a54e2291c017397ceff60511c29fe70d229bc8b.zip
Merge branch 'master' into wlr-gamma-control
Diffstat (limited to 'completions')
-rw-r--r--completions/bash/sway46
-rw-r--r--completions/bash/swayidle48
-rw-r--r--completions/bash/swaylock66
-rw-r--r--completions/bash/swaymsg59
-rw-r--r--completions/zsh/_sway2
-rw-r--r--completions/zsh/_swaygrab23
-rw-r--r--completions/zsh/_swaymsg3
7 files changed, 223 insertions, 24 deletions
diff --git a/completions/bash/sway b/completions/bash/sway
new file mode 100644
index 00000000..edd752cd
--- /dev/null
+++ b/completions/bash/sway
@@ -0,0 +1,46 @@
1# sway(1) completion
2
3_sway()
4{
5 local cur prev
6 _get_comp_words_by_ref cur prev
7
8 short=(
9 -h
10 -c
11 -C
12 -d
13 -v
14 -V
15 )
16
17 long=(
18 --help
19 --config
20 --validate
21 --debug
22 --version
23 --verbose
24 --get-socketpath
25 )
26
27 case $prev in
28 -c|--config)
29 _filedir
30 return
31 ;;
32 esac
33
34 if [[ $cur == --* ]]; then
35 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
36 elif [[ $cur == -* ]]; then
37 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
38 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
39 else
40 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
41 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
42 COMPREPLY+=($(compgen -c -- "$cur"))
43 fi
44
45} &&
46complete -F _sway sway
diff --git a/completions/bash/swayidle b/completions/bash/swayidle
new file mode 100644
index 00000000..a0cdc8b2
--- /dev/null
+++ b/completions/bash/swayidle
@@ -0,0 +1,48 @@
1# swaymsg(1) completion
2
3_swayidle()
4{
5 local cur prev
6 _get_comp_words_by_ref -n : cur prev
7 local prev2=${COMP_WORDS[COMP_CWORD-2]}
8 local prev3=${COMP_WORDS[COMP_CWORD-3]}
9
10 events=(
11 'timeout'
12 'before-sleep'
13 )
14
15 short=(
16 -h
17 -d
18 )
19
20 if [ "$prev" = timeout ]; then
21 # timeout <timeout>
22 return
23 elif [ "$prev2" = timeout ]; then
24 # timeout <timeout> <timeout command>
25 COMPREPLY=($(compgen -c -- "$cur"))
26 return
27 elif [ "$prev3" = timeout ]; then
28 # timeout <timeout> <timeout command> [resume <resume command>]
29 COMPREPLY=(resume)
30 # optional argument; no return here as user may skip 'resume'
31 fi
32
33 case "$prev" in
34 resume)
35 COMPREPLY=($(compgen -c -- "$cur"))
36 return
37 ;;
38 before-sleep)
39 COMPREPLY=($(compgen -c -- "$cur"))
40 return
41 ;;
42 esac
43
44 COMPREPLY+=($(compgen -W "${events[*]}" -- "$cur"))
45 COMPREPLY+=($(compgen -W "${short[*]}" -- "$cur"))
46
47} &&
48complete -F _swayidle swayidle
diff --git a/completions/bash/swaylock b/completions/bash/swaylock
new file mode 100644
index 00000000..33925480
--- /dev/null
+++ b/completions/bash/swaylock
@@ -0,0 +1,66 @@
1# swaylock(1) completion
2
3_swaylock()
4{
5 local cur prev
6 _get_comp_words_by_ref -n : cur prev
7
8 short=(
9 -h
10 -c
11 -s
12 -t
13 -v
14 -i
15 -u
16 -f
17 )
18
19 long=(
20 --help
21 --color
22 --scaling
23 --tiling
24 --version
25 --image
26 --no-unlock-indicator
27 --daemonize
28 )
29
30 scaling=(
31 'stretch'
32 'fill'
33 'fit'
34 'center'
35 'tile'
36 )
37
38 case $prev in
39 -c|--color)
40 return
41 ;;
42 --scaling)
43 COMPREPLY=($(compgen -W "${scaling[*]}" -- "$cur"))
44 return
45 ;;
46 -i|--image)
47 if grep -q : <<< "$cur"; then
48 output="${cur%%:*}:"
49 cur="${cur#*:}"
50 else
51 output=
52 fi
53 COMPREPLY=($(compgen -f -- "$cur"))
54 return
55 ;;
56 esac
57
58 if [[ $cur == --* ]]; then
59 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
60 else
61 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
62 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
63 fi
64
65} &&
66complete -F _swaylock swaylock
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
diff --git a/completions/zsh/_sway b/completions/zsh/_sway
index bab90fbf..05112002 100644
--- a/completions/zsh/_sway
+++ b/completions/zsh/_sway
@@ -18,5 +18,5 @@ _arguments -s \
18 '(-c --config)'{-c,--config}'[Specify a config file]:files:_files' \ 18 '(-c --config)'{-c,--config}'[Specify a config file]:files:_files' \
19 '(-C --validate)'{-C,--validate}'[Check validity of the config file, then exit]' \ 19 '(-C --validate)'{-C,--validate}'[Check validity of the config file, then exit]' \
20 '(-d --debug)'{-d,--debug}'[Enables full logging, including debug information]' \ 20 '(-d --debug)'{-d,--debug}'[Enables full logging, including debug information]' \
21 '(-v --verbose)'{-v,--verbose}'[Enables more verbose logging]' \ 21 '(-V --verbose)'{-V,--verbose}'[Enables more verbose logging]' \
22 '(--get-socketpath)'--get-socketpath'[Gets the IPC socket path and prints it, then exits]' 22 '(--get-socketpath)'--get-socketpath'[Gets the IPC socket path and prints it, then exits]'
diff --git a/completions/zsh/_swaygrab b/completions/zsh/_swaygrab
deleted file mode 100644
index 0f9846f4..00000000
--- a/completions/zsh/_swaygrab
+++ /dev/null
@@ -1,23 +0,0 @@
1#compdef swaygrab
2#-----------------
3# Description
4# -----------
5#
6# Completion script for swaygrab in sway wm (http://swaywm.org)
7#
8# -----------------------------------------------------
9# Author
10# ------
11#
12# * Seth Barberee <seth.barberee@gmail.com>
13#
14# ------------------------------------------
15
16_arguments -s \
17 '(-h --help)'{-h,--help}'[Shows help message]' \
18 '(-c --capture)'{-c,--capture}'[Captures multiple frames as video and passes them to ffmpeg]' \
19 '(-o --output)'{-o,--output}'[Use the specified output. If not specified then current focused output will be used]' \
20 '(-v --version)'{-v,--version}'[Print the version (of swaymsg) and quit]' \
21 '(-s --socket)'{-s,--socket}'[Use the specified socket path.]:files:_files' \
22 '(-r --rate)'{-r,--rate}'[Specify a framerate (in fps). Used in combination with -c. Default is 30 and must be an integer]' \
23 '(--raw)--raw[Instead of ImageMagick or ffmpeg, dump raw rgba data to stdout]'
diff --git a/completions/zsh/_swaymsg b/completions/zsh/_swaymsg
index 2e39deb6..a7a1c8e0 100644
--- a/completions/zsh/_swaymsg
+++ b/completions/zsh/_swaymsg
@@ -22,6 +22,9 @@ types=(
22'get_marks' 22'get_marks'
23'get_bar_config' 23'get_bar_config'
24'get_version' 24'get_version'
25'get_binding_modes'
26'get_config'
27'send_tick'
25) 28)
26 29
27_arguments -s \ 30_arguments -s \