1#autoload
2
3local list expl
4
5_tags windows || return 1
6
7list=( "${(@)${(M@)${(@f)$(_call_program windows xwininfo -root -tree)}:#[ 	]#0x[0-9a-f]# \"*}##[ 	]#}" )
8
9if [[ "$1" = -n ]]; then
10  shift
11
12  _wanted windows expl 'window name' \
13      compadd "$@" -d list - "${(@)${(@)list#*\"}%%\"*}"
14else
15  [[ "$1" = - ]] && shift
16
17  _wanted windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
18fi
19