mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
manual/7562
This commit is contained in:
parent
57e98c6948
commit
8e5365152a
4 changed files with 55 additions and 7 deletions
6
Completion/X/_x_arguments
Normal file
6
Completion/X/_x_arguments
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#compdef -P */X11/*
|
||||||
|
|
||||||
|
_arguments \
|
||||||
|
'-display:display:_x_display' \
|
||||||
|
'-geometry:geometry:_x_geometry' \
|
||||||
|
"$@"
|
24
Completion/X/_x_color
Normal file
24
Completion/X/_x_color
Normal file
|
@ -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[@]"
|
18
Completion/X/_x_cursor
Normal file
18
Completion/X/_x_cursor
Normal file
|
@ -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[@]"
|
|
@ -7,22 +7,22 @@ for file in $FUNCTIONS_INSTALL; do
|
||||||
if test -f "$sdir/$file"; then
|
if test -f "$sdir/$file"; then
|
||||||
install="$install $file"
|
install="$install $file"
|
||||||
else
|
else
|
||||||
install="$install `echo $sdir/$file | sed -e \"s%$sdir/%%g\"`"
|
install="$install `echo '' $sdir/$file | sed -e \"s% $sdir/%%g\"`"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for file in $install; do
|
for file in $install; do
|
||||||
if test -f $sdir/$file; then
|
if test -f $sdir/$file; then
|
||||||
if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
|
if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
|
||||||
rm -f $fndir/$file;
|
rm -f $DESTDIR$fndir/$file;
|
||||||
if test -f $fndir.old/$file; then
|
if test -f $DESTDIR$fndir.old/$file; then
|
||||||
mv $fndir.old/$file $fndir/$file
|
mv $DESTDIR$fndir.old/$file $DESTDIR$fndir/$file
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
bfile="`echo $file | sed -e 's%^.*/%%'`"
|
bfile="`echo $file | sed -e 's%^.*/%%'`"
|
||||||
rm -f "$fndir/$bfile"; \
|
rm -f "$DESTDIR$fndir/$bfile"; \
|
||||||
if test -f $fndir.old/$bfile; then
|
if test -f $DESTDIR$fndir.old/$bfile; then
|
||||||
mv $fndir.old/$bfile $fndir/$bfile
|
mv $DESTDIR$fndir.old/$bfile $DESTDIR$fndir/$bfile
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue