1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/doc/zsh/_polybar_msg

33 lines
826 B
Text
Raw Normal View History

2017-01-13 01:28:21 -05:00
#compdef polybar-msg
#
# Completion for polybar-msg (https://github.com/jaagr/polybar)
# jaagr <c@rlberg.se>
#
_polybar_msg() {
integer ret=1
_arguments -n : \
'-p[Process id of target instance]:process id:_polybar_msg_pids' \
'(-p)1:message type:(action cmd hook)' \
'*:: :->args'
case $state in
args)
case $words[1] in
hook) _arguments ':module name:' ':hook index:'; ret=0 ;;
action) _arguments ':action payload:'; ret=0 ;;
2017-04-21 12:15:18 -04:00
cmd) _arguments ':command payload:(show hide toggle restart quit)'; ret=0 ;;
2017-01-13 01:28:21 -05:00
esac
;;
esac
return $ret
}
(( $+functions[_polybar_msg_pids] )) || _polybar_msg_pids() {
local pids; pids=(${(f)"$(ls -1 /tmp/polybar_mqueue.* | egrep -o '[0-9]+$')"})
_describe -t pids 'process id of target instance' pids
}
_polybar_msg "$@"