1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-27 14:11:14 +01:00
zsh/Completion/X/_x_window

18 lines
394 B
Text

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