aboutsummaryrefslogtreecommitdiff
path: root/completions/zsh/_swayidle
diff options
context:
space:
mode:
authorRéouven Assouly <reouvenassouly@yahoo.fr>2019-01-01 16:16:11 +0100
committerBrian Ashworth <bosrsf04@gmail.com>2019-01-02 21:38:32 -0500
commitcf00fb2ccc2063fbbd5b72e0d3b8e75697243c3b (patch)
tree396cf56d64b974593ec69110a9418e4b9ff02405 /completions/zsh/_swayidle
parent5bf4daf2634929e7c94a6c7e56eda66d4667ca2f (diff)
downloadsway-cf00fb2ccc2063fbbd5b72e0d3b8e75697243c3b.tar.xz
zsh: update completions
Diffstat (limited to 'completions/zsh/_swayidle')
-rw-r--r--completions/zsh/_swayidle22
1 files changed, 22 insertions, 0 deletions
diff --git a/completions/zsh/_swayidle b/completions/zsh/_swayidle
new file mode 100644
index 00000000..b419bc2c
--- /dev/null
+++ b/completions/zsh/_swayidle
@@ -0,0 +1,22 @@
+#compdef swayidle
+#
+# Completion script for swayidle
+#
+
+local events=('timeout:Execute timeout command if there is no activity for timeout seconds'
+ 'before-sleep:Execute before-sleep command before sleep')
+local resume=('resume:Execute command when there is activity again')
+
+if (($#words <= 2)); then
+ _arguments -C \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-d)'-d'[Enable debug output]'
+ _describe -t "events" 'swayidle' events
+
+elif [[ "$words[-3]" == before-sleep || "$words[-3]" == resume ]]; then
+ _describe -t "events" 'swayidle' events
+
+elif [[ "$words[-4]" == timeout ]]; then
+ _describe -t "events" 'swayidle' events
+ _describe -t "resume" 'swayidle' resume
+fi