mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-20 05:53:52 +01:00
20 lines
399 B
Plaintext
20 lines
399 B
Plaintext
|
#autoload
|
||
|
|
||
|
setopt localoptions extendedglob
|
||
|
|
||
|
local list expl
|
||
|
|
||
|
list=( "${(@)${(M@)${(@f)$(xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" )
|
||
|
|
||
|
if [[ "$1" = -n ]]; then
|
||
|
shift
|
||
|
|
||
|
_description expl 'window name'
|
||
|
compadd "$@" "$expl[@]" -d list - "${(@)${(@)list#*\"}%%\"*}"
|
||
|
else
|
||
|
[[ "$1" = - ]] && shift
|
||
|
|
||
|
_description expl 'window ID'
|
||
|
compadd "$@" "$expl[@]" -d list - "${(@)list%% *}"
|
||
|
fi
|