aboutsummaryrefslogtreecommitdiff
path: root/completions/zsh/_swayidle
blob: b419bc2cd39020cb5c79fad4a587c8eb4c1205dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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