about summary refs log tree commit diff
path: root/Completion/X
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-31 10:23:46 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-31 10:23:46 +0000
commit8e5365152aa58bb0d8a209efe176e1e7ae70675f (patch)
tree0a41625f8d28369c17c2fc8345d16e73a2610df8 /Completion/X
parent57e98c6948f0cb64e79c4455fc692d81a75e30bf (diff)
downloadzsh-8e5365152aa58bb0d8a209efe176e1e7ae70675f.tar.gz
zsh-8e5365152aa58bb0d8a209efe176e1e7ae70675f.tar.xz
zsh-8e5365152aa58bb0d8a209efe176e1e7ae70675f.zip
manual/7562
Diffstat (limited to 'Completion/X')
-rw-r--r--Completion/X/_x_arguments6
-rw-r--r--Completion/X/_x_color24
-rw-r--r--Completion/X/_x_cursor18
3 files changed, 48 insertions, 0 deletions
diff --git a/Completion/X/_x_arguments b/Completion/X/_x_arguments
new file mode 100644
index 000000000..23243002c
--- /dev/null
+++ b/Completion/X/_x_arguments
@@ -0,0 +1,6 @@
+#compdef -P */X11/*
+
+_arguments \
+  '-display:display:_x_display' \
+  '-geometry:geometry:_x_geometry' \
+  "$@"
diff --git a/Completion/X/_x_color b/Completion/X/_x_color
new file mode 100644
index 000000000..346142eea
--- /dev/null
+++ b/Completion/X/_x_color
@@ -0,0 +1,24 @@
+#autoload
+
+local expl
+
+if (( ! $+_color_cache )); then
+  local file
+
+  # Cache of color names doesn't exist yet, create it.
+
+  file=( /usr/{lib,{{X11R6,openwin},local{,/X11{,R6}}}/lib}/X11/rgb.txt(N) )
+
+  if (( $#file )); then
+    _color_cache=( "${(@)${(@f)$(< $file[1])}[2,-1]##*		}" )
+  else
+
+    # Stupid default value.
+
+    _color_cache=(white black gray red blue green)
+  fi
+fi
+
+_description expl 'color specification'
+compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} m:-=\  r:|[ A-Z0-9]=* r:|=*' - \
+        "$_color_cache[@]"
diff --git a/Completion/X/_x_cursor b/Completion/X/_x_cursor
new file mode 100644
index 000000000..59ecb5976
--- /dev/null
+++ b/Completion/X/_x_cursor
@@ -0,0 +1,18 @@
+#autoload
+
+local expl
+
+if (( ! $+_cursor_cache )); then
+  local file
+
+  file=( /usr/{include,{{X11R6,openwin},local{,/X11{,R6}}}/include}/X11/cursorfont.h(N) )
+
+  if (( $#file )); then
+    _cursor_cache=( "${(@)${(@)${(M@)${(@f)$(< $file[1])}:#*XC_*}[2,-1]#* XC_}% *}" )
+  else
+    _cursor_cache=( X_cursor )
+  fi
+fi
+
+_description expl 'cursor name'
+compadd "$@" "$expl[@]" -M 'm:-=_ r:|_=*' - "$_cursor_cache[@]"