parent
5bf4daf263
commit
cf00fb2ccc
@ -0,0 +1,13 @@
|
||||
#compdef swaybar
|
||||
#
|
||||
# Completion script for swaybar
|
||||
#
|
||||
|
||||
local bars=($(swaymsg -t get_bar_config | sed -e '/^\[/,/\]$/{//d;s/^ *"\(.*\)",\?.*$/\1/}'))
|
||||
|
||||
_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]'
|
@ -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
|
Loading…
Reference in new issue