about summary refs log tree commit diff
path: root/Completion/X/_x_window
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-21 01:34:56 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-21 01:34:56 +0000
commit4a662b72f11398d648ea65644cd6416176d7241d (patch)
tree7f871a6459ffe446339dca060ff4deb7b4ff14d6 /Completion/X/_x_window
parent343829717ac96577fd81a42fd32f2fd737e725e6 (diff)
downloadzsh-4a662b72f11398d648ea65644cd6416176d7241d.tar.gz
zsh-4a662b72f11398d648ea65644cd6416176d7241d.tar.xz
zsh-4a662b72f11398d648ea65644cd6416176d7241d.zip
Initial revision
Diffstat (limited to 'Completion/X/_x_window')
-rw-r--r--Completion/X/_x_window19
1 files changed, 19 insertions, 0 deletions
diff --git a/Completion/X/_x_window b/Completion/X/_x_window
new file mode 100644
index 000000000..118c7f131
--- /dev/null
+++ b/Completion/X/_x_window
@@ -0,0 +1,19 @@
+#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