1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 14:04:03 +01:00
zsh/Completion/X/_x_window

19 lines
394 B
Plaintext
Raw Normal View History

1999-09-21 03:34:56 +02:00
#autoload
local list expl
_tags windows || return 1
2000-04-01 22:43:43 +02:00
list=( "${(@)${(M@)${(@f)$(_call windows xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" )
1999-09-21 03:34:56 +02:00
if [[ "$1" = -n ]]; then
shift
_wanted windows expl 'window name' \
2000-04-01 22:43:43 +02:00
compadd "$@" -d list - "${(@)${(@)list#*\"}%%\"*}"
1999-09-21 03:34:56 +02:00
else
[[ "$1" = - ]] && shift
_wanted windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
1999-09-21 03:34:56 +02:00
fi