summaryrefslogtreecommitdiffstats
path: root/completions
diff options
context:
space:
mode:
Diffstat (limited to 'completions')
-rw-r--r--completions/bash/swaybar44
-rw-r--r--completions/bash/swayidle48
-rw-r--r--completions/fish/swayidle.fish3
-rw-r--r--completions/zsh/_sway4
-rw-r--r--completions/zsh/_swaybar13
-rw-r--r--completions/zsh/_swaylock40
-rw-r--r--completions/zsh/_swaymsg12
7 files changed, 99 insertions, 65 deletions
diff --git a/completions/bash/swaybar b/completions/bash/swaybar
new file mode 100644
index 00000000..1e085c65
--- /dev/null
+++ b/completions/bash/swaybar
@@ -0,0 +1,44 @@
1# swaybar(1) completion
2
3_swaybar()
4{
5 local cur prev
6 _get_comp_words_by_ref cur prev
7
8 short=(
9 -h
10 -v
11 -s
12 -b
13 -d
14 )
15
16 long=(
17 --help
18 --version
19 --socket
20 --bar_id
21 --debug
22 )
23
24 case $prev in
25 -s|--socket)
26 _filedir
27 return
28 ;;
29 -b|--bar_id)
30 bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
31 COMPREPLY=($(compgen -W "${bars[*]}" -- "$cur"))
32 return
33 ;;
34 esac
35
36 if [[ $cur == --* ]]; then
37 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
38 else
39 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
40 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
41 fi
42
43} &&
44complete -F _swaybar swaybar
diff --git a/completions/bash/swayidle b/completions/bash/swayidle
deleted file mode 100644
index a0cdc8b2..00000000
--- a/completions/bash/swayidle
+++ /dev/null
@@ -1,48 +0,0 @@
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/fish/swayidle.fish b/completions/fish/swayidle.fish
deleted file mode 100644
index 71279925..00000000
--- a/completions/fish/swayidle.fish
+++ /dev/null
@@ -1,3 +0,0 @@
1# swayidle
2complete -c swayidle -s h --description 'show help'
3complete -c swayidle -s d --description 'debug'
diff --git a/completions/zsh/_sway b/completions/zsh/_sway
index 05112002..a7f55cc5 100644
--- a/completions/zsh/_sway
+++ b/completions/zsh/_sway
@@ -13,8 +13,8 @@
13# 13#
14# ------------------------------- 14# -------------------------------
15_arguments -s \ 15_arguments -s \
16 '(-v --version)'{-v,--version}'[shows version]' \ 16 '(-v --version)'{-v,--version}'[Show the version number and quit]' \
17 '(-h --help)'{-h,--help}'[shows help message]' \ 17 '(-h --help)'{-h,--help}'[Show help message and quit]' \
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]' \
diff --git a/completions/zsh/_swaybar b/completions/zsh/_swaybar
new file mode 100644
index 00000000..af2cee95
--- /dev/null
+++ b/completions/zsh/_swaybar
@@ -0,0 +1,13 @@
1#compdef swaybar
2#
3# Completion script for swaybar
4#
5
6local bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
7
8_arguments -s \
9 '(-h --help)'{-h,--help}'[Show help message and quit]' \
10 '(-v --version)'{-v,--version}'[Show version and quit]' \
11 '(-s --socket)'{-s,--socket}'[Connect to sway via socket]:filename:_files' \
12 '(-b --bar_id)'{-b,--bar-id}'[Bar ID for which to get the configuration]:filename:($bars)'\
13 '(-d --debug)'{-d,--debug}'[Enable debugging]'
diff --git a/completions/zsh/_swaylock b/completions/zsh/_swaylock
index 8fb4834c..9bc84ec9 100644
--- a/completions/zsh/_swaylock
+++ b/completions/zsh/_swaylock
@@ -4,11 +4,37 @@
4# 4#
5 5
6_arguments -s \ 6_arguments -s \
7 '(-v --version)'{-v,--version}'[Show the version number and quit]' \ 7 '(-C --config)'{-C,--config}'[Path to the config file]:filename:_files' \
8 '(-h --help)'{-h,--help}'[Show help message and quit]' \ 8 '(-c --color)'{-c,--color}'[Turn the screen into the given color instead of white]:color:' \
9 '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal]' \ 9 '(-e --ignore-empty-password)'{-e,--ignore-empty-password}'[When an empty password is provided, do not validate it]' \
10 '(-c --color)'{-c,--color}'[Specify a color (rrggbb)]' \ 10 '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal after locking]' \
11 '(-i --image)'{-i,--image}'[Display an image]:files:_files' \ 11 '(-h --help)'{-h,--help}'[Show help message and quit]' \
12 '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \ 12 '(-i --image)'{-i,--image}'[Display an image]:filename:_files' \
13 '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \
14 '(-t --tiling)'{-t,--tiling}'[Same as --scaling=tile]' \
13 '(-u --no-unlock-indicator)'{-u,--no-unlock-indicator}'[Disable the unlock indicator]' \ 15 '(-u --no-unlock-indicator)'{-u,--no-unlock-indicator}'[Disable the unlock indicator]' \
14 '(--socket)'--socket'[Use the specified socket path.]:files:_files' \ 16 '(-v --version)'{-v,--version}'[Show the version number and quit]' \
17 '(--bs-hl-color)'--bs-hl-color'[Sets the color of backspace highlights segments]:color:' \
18 '(--font)'--font'[Sets the font of the text]:font:' \
19 '(--indicator-radius)'--indicator-radius'[Sets the indicator radius]:radius:' \
20 '(--indicator-thickness)'--indicator-thickness'[Sets the indicator thickness]:thickness:' \
21 '(--inside-color)'--inside-color'[Sets the color of the inside of the indicator]:color:' \
22 '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when cleared]:color:' \
23 '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when verifying]:color:' \
24 '(--inside-wrong-color)'--inside-wrong-color'[Sets the color of the inside of the indicator when invalid]:color:' \
25 '(--key-hl-color)'--key-hl-color'[Sets the color of the key press highlight segments]:color:' \
26 '(--line-color)'--line-color'[Sets the color of the line between the inside and ring]:color:' \
27 '(--line-clear-color)'--line-clear-color'[Sets the color of the line between the inside and ring when cleared]:color:' \
28 '(--line-ver-color)'--line-ver-color'[Sets the color of the line between the inside and ring when verifying]:color:' \
29 '(--line-wrong-color)'--line-wrong-color'[Sets the color of the line between the inside and ring when invalid]:color:' \
30 '(-n --line-uses-inside)'{-n,--line-uses-inside}'[Use the inside color for the line between the inside and ring]' \
31 '(-r --line-uses-ring)'{-r,--line--uses-ring}'[Use the ring color for the line between the inside and ring]' \
32 '(--ring-color)'--ring-color'[Sets the color of the ring of the indicator]:color:' \
33 '(--ring-clear-color)'--ring-clear-color'[Sets the color of the ring of the indicator when cleared]:color:' \
34 '(--ring-ver-color)'--ring-ver-color'[Sets the color of the ring of the indicator when verifying]:color:' \
35 '(--ring-wrong-color)'--ring-wrong-color'[Sets the color of the ring of the indicator when invalid]:color:' \
36 '(--separator-color)'--separator-color'[Sets the color of the lines that separate highlight segments]:color:' \
37 '(--text-color)'--text-color'[Sets the color of the text]:color:' \
38 '(--text-clear-color)'--text-clear-color'[Sets the color of the text when cleared]:color:' \
39 '(--text-ver-color)'--text-ver-color'[Sets the color of the text when verifying]:color:' \
40 '(--text-wrong-color)'--text-wrong-color'[Sets the color of the text when invalid]:color:' \ No newline at end of file
diff --git a/completions/zsh/_swaymsg b/completions/zsh/_swaymsg
index a7a1c8e0..0ba45d4a 100644
--- a/completions/zsh/_swaymsg
+++ b/completions/zsh/_swaymsg
@@ -28,8 +28,10 @@ types=(
28) 28)
29 29
30_arguments -s \ 30_arguments -s \
31 '(-v --version)'{-v,--version}'[Print the version (of swaymsg) and quit]' \ 31 '(-v --version)'{-v,--version}'[Show the version number and quit]' \
32 '(-h --help)'{-h,--help}'[Shows help message]' \ 32 '(-m --monitor)'{-m,--monitor}'[Monitor until killed (-t SUBSCRIBE only)]' \
33 '(-q --quiet)'{-q,--quiet}'[Sends the IPC message but does not print the response from sway]' \ 33 '(-h --help)'{-h,--help}'[Show help message and quit]' \
34 '(-s --socket)'{-s,--socket}'[Use the specified socket path.]:files:_files' \ 34 '(-q --quiet)'{-q,--quiet}'[Be quiet]' \
35 '(-t --type)'{-t,--type}'[Specify the type of IPC message.]:type:{_describe "type" types}' 35 '(-r --raw)'{-r,--raw}'[Use raw output even if using a tty]' \
36 '(-s --socket)'{-s,--socket}'[Use the specified socket path]:files:_files' \
37 '(-t --type)'{-t,--type}'[Specify the message type]:type:{_describe "type" types}'