aboutsummaryrefslogtreecommitdiff
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 @@
+# swaybar(1) completion
+
+_swaybar()
+{
+ local cur prev
+ _get_comp_words_by_ref cur prev
+
+ short=(
+ -h
+ -v
+ -s
+ -b
+ -d
+ )
+
+ long=(
+ --help
+ --version
+ --socket
+ --bar_id
+ --debug
+ )
+
+ case $prev in
+ -s|--socket)
+ _filedir
+ return
+ ;;
+ -b|--bar_id)
+ bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
+ COMPREPLY=($(compgen -W "${bars[*]}" -- "$cur"))
+ return
+ ;;
+ esac
+
+ if [[ $cur == --* ]]; then
+ COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
+ else
+ COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
+ COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
+ fi
+
+} &&
+complete -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 @@
-# swaymsg(1) completion
-
-_swayidle()
-{
- local cur prev
- _get_comp_words_by_ref -n : cur prev
- local prev2=${COMP_WORDS[COMP_CWORD-2]}
- local prev3=${COMP_WORDS[COMP_CWORD-3]}
-
- events=(
- 'timeout'
- 'before-sleep'
- )
-
- short=(
- -h
- -d
- )
-
- if [ "$prev" = timeout ]; then
- # timeout <timeout>
- return
- elif [ "$prev2" = timeout ]; then
- # timeout <timeout> <timeout command>
- COMPREPLY=($(compgen -c -- "$cur"))
- return
- elif [ "$prev3" = timeout ]; then
- # timeout <timeout> <timeout command> [resume <resume command>]
- COMPREPLY=(resume)
- # optional argument; no return here as user may skip 'resume'
- fi
-
- case "$prev" in
- resume)
- COMPREPLY=($(compgen -c -- "$cur"))
- return
- ;;
- before-sleep)
- COMPREPLY=($(compgen -c -- "$cur"))
- return
- ;;
- esac
-
- COMPREPLY+=($(compgen -W "${events[*]}" -- "$cur"))
- COMPREPLY+=($(compgen -W "${short[*]}" -- "$cur"))
-
-} &&
-complete -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 @@
-# swayidle
-complete -c swayidle -s h --description 'show help'
-complete -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 @@
#
# -------------------------------
_arguments -s \
- '(-v --version)'{-v,--version}'[shows version]' \
- '(-h --help)'{-h,--help}'[shows help message]' \
+ '(-v --version)'{-v,--version}'[Show the version number and quit]' \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
'(-c --config)'{-c,--config}'[Specify a config file]:files:_files' \
'(-C --validate)'{-C,--validate}'[Check validity of the config file, then exit]' \
'(-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 @@
+#compdef swaybar
+#
+# Completion script for swaybar
+#
+
+local bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
+
+_arguments -s \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-v --version)'{-v,--version}'[Show version and quit]' \
+ '(-s --socket)'{-s,--socket}'[Connect to sway via socket]:filename:_files' \
+ '(-b --bar_id)'{-b,--bar-id}'[Bar ID for which to get the configuration]:filename:($bars)'\
+ '(-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 @@
#
_arguments -s \
- '(-v --version)'{-v,--version}'[Show the version number and quit]' \
- '(-h --help)'{-h,--help}'[Show help message and quit]' \
- '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal]' \
- '(-c --color)'{-c,--color}'[Specify a color (rrggbb)]' \
- '(-i --image)'{-i,--image}'[Display an image]:files:_files' \
- '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \
+ '(-C --config)'{-C,--config}'[Path to the config file]:filename:_files' \
+ '(-c --color)'{-c,--color}'[Turn the screen into the given color instead of white]:color:' \
+ '(-e --ignore-empty-password)'{-e,--ignore-empty-password}'[When an empty password is provided, do not validate it]' \
+ '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal after locking]' \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-i --image)'{-i,--image}'[Display an image]:filename:_files' \
+ '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \
+ '(-t --tiling)'{-t,--tiling}'[Same as --scaling=tile]' \
'(-u --no-unlock-indicator)'{-u,--no-unlock-indicator}'[Disable the unlock indicator]' \
- '(--socket)'--socket'[Use the specified socket path.]:files:_files' \
+ '(-v --version)'{-v,--version}'[Show the version number and quit]' \
+ '(--bs-hl-color)'--bs-hl-color'[Sets the color of backspace highlights segments]:color:' \
+ '(--font)'--font'[Sets the font of the text]:font:' \
+ '(--indicator-radius)'--indicator-radius'[Sets the indicator radius]:radius:' \
+ '(--indicator-thickness)'--indicator-thickness'[Sets the indicator thickness]:thickness:' \
+ '(--inside-color)'--inside-color'[Sets the color of the inside of the indicator]:color:' \
+ '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when cleared]:color:' \
+ '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when verifying]:color:' \
+ '(--inside-wrong-color)'--inside-wrong-color'[Sets the color of the inside of the indicator when invalid]:color:' \
+ '(--key-hl-color)'--key-hl-color'[Sets the color of the key press highlight segments]:color:' \
+ '(--line-color)'--line-color'[Sets the color of the line between the inside and ring]:color:' \
+ '(--line-clear-color)'--line-clear-color'[Sets the color of the line between the inside and ring when cleared]:color:' \
+ '(--line-ver-color)'--line-ver-color'[Sets the color of the line between the inside and ring when verifying]:color:' \
+ '(--line-wrong-color)'--line-wrong-color'[Sets the color of the line between the inside and ring when invalid]:color:' \
+ '(-n --line-uses-inside)'{-n,--line-uses-inside}'[Use the inside color for the line between the inside and ring]' \
+ '(-r --line-uses-ring)'{-r,--line--uses-ring}'[Use the ring color for the line between the inside and ring]' \
+ '(--ring-color)'--ring-color'[Sets the color of the ring of the indicator]:color:' \
+ '(--ring-clear-color)'--ring-clear-color'[Sets the color of the ring of the indicator when cleared]:color:' \
+ '(--ring-ver-color)'--ring-ver-color'[Sets the color of the ring of the indicator when verifying]:color:' \
+ '(--ring-wrong-color)'--ring-wrong-color'[Sets the color of the ring of the indicator when invalid]:color:' \
+ '(--separator-color)'--separator-color'[Sets the color of the lines that separate highlight segments]:color:' \
+ '(--text-color)'--text-color'[Sets the color of the text]:color:' \
+ '(--text-clear-color)'--text-clear-color'[Sets the color of the text when cleared]:color:' \
+ '(--text-ver-color)'--text-ver-color'[Sets the color of the text when verifying]:color:' \
+ '(--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=(
)
_arguments -s \
- '(-v --version)'{-v,--version}'[Print the version (of swaymsg) and quit]' \
- '(-h --help)'{-h,--help}'[Shows help message]' \
- '(-q --quiet)'{-q,--quiet}'[Sends the IPC message but does not print the response from sway]' \
- '(-s --socket)'{-s,--socket}'[Use the specified socket path.]:files:_files' \
- '(-t --type)'{-t,--type}'[Specify the type of IPC message.]:type:{_describe "type" types}'
+ '(-v --version)'{-v,--version}'[Show the version number and quit]' \
+ '(-m --monitor)'{-m,--monitor}'[Monitor until killed (-t SUBSCRIBE only)]' \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-q --quiet)'{-q,--quiet}'[Be quiet]' \
+ '(-r --raw)'{-r,--raw}'[Use raw output even if using a tty]' \
+ '(-s --socket)'{-s,--socket}'[Use the specified socket path]:files:_files' \
+ '(-t --type)'{-t,--type}'[Specify the message type]:type:{_describe "type" types}'