HEX
Server: Apache
System: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User: u117253157 (2065952)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //usr/share/zsh/functions/Completion/X/_x_window
#autoload

local list expl

_tags windows || return 1

list=( "${(@)${(M@)${(@f)$(_call_program 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