1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 05:53:52 +01:00
zsh/Completion/X/_x_window
2000-04-01 20:43:43 +00:00

19 lines
404 B
Plaintext

#autoload
local list expl
_wanted windows || return 1
list=( "${(@)${(M@)${(@f)$(_call windows xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" )
if [[ "$1" = -n ]]; then
shift
_all_labels windows expl 'window name' \
compadd "$@" -d list - "${(@)${(@)list#*\"}%%\"*}"
else
[[ "$1" = - ]] && shift
_all_labels windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
fi