summaryrefslogtreecommitdiff
path: root/Completion/X/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/X/Command')
-rw-r--r--Completion/X/Command/_evince1
-rw-r--r--Completion/X/Command/_okular2
-rw-r--r--Completion/X/Command/_qiv6
-rw-r--r--Completion/X/Command/_setxkbmap210
-rw-r--r--Completion/X/Command/_xdvi18
-rw-r--r--Completion/X/Command/_zeal1
6 files changed, 136 insertions, 102 deletions
diff --git a/Completion/X/Command/_evince b/Completion/X/Command/_evince
index 21b493360..49f11f341 100644
--- a/Completion/X/Command/_evince
+++ b/Completion/X/Command/_evince
@@ -15,6 +15,7 @@ _arguments -s -S \
'--g-fatal-warnings[make all warnings fatal]' \
'--gtk-debug=[specify GTK+ debugging flags to set]:flag' \
'--gtk-no-debug=[specify GTK+ debugging flags to unset]:flag' \
+ '(-o --new-window)'{-o,--new-window}'[open a new window]' \
'(-p --page-label -i --page-index -n --named-dest)'{-p,--page-label=}'[specify page label of the document to display]' \
'(-p --page-label -i --page-index -n --named-dest)'{-i,--page-index=}'[specify page number of the document to display]' \
'(-p --page-label -i --page-index -n --named-dest)'{-n,--named-dest=}'[specify named destination to display]' \
diff --git a/Completion/X/Command/_okular b/Completion/X/Command/_okular
index f08f81c6e..9d5a3d7ff 100644
--- a/Completion/X/Command/_okular
+++ b/Completion/X/Command/_okular
@@ -1,7 +1,7 @@
#compdef okular
local extns
-extns="(pdf|ps|eps|dvi)(|.gz|.bz2)|djvu|tif|tiff|chm|cbr|cbz"
+extns="(pdf|ps|eps|dvi)(|.gz|.bz2)|djvu|tif|tiff|chm|cbr|cbz|epub"
_arguments \
'(-p --page)'{-p,--page}'[page of the document to be shown]:page: ' \
diff --git a/Completion/X/Command/_qiv b/Completion/X/Command/_qiv
index 35ceec09a..5d0aa8faf 100644
--- a/Completion/X/Command/_qiv
+++ b/Completion/X/Command/_qiv
@@ -10,6 +10,7 @@ _arguments -s \
'(-C --cycle)'{-C,--cycle}"[don't cycle after last image]" \
'(-w --fixed_width -W --fixed_zoom)'{-w,--fixed_width}'[use window with specified width]:width' \
'(-w --fixed_width -W --fixed_zoom)'{-W,--fixed_zoom}'[use window with specified zoom factor]:zoom (percentage)' \
+ '--highDPIfactor[specify resize factor to compensate for high (or also low) DPI screens]:factor' \
'(-x -y -z --root --root_t --root_s -f --file *)'{-x,--root}'[use image as the current desktop background, centered]:image file:_files' \
'(-x -y -z --root --root_t --root_s -f --file *)'{-y,--root_t}'[use image on the current desktop background, tiled]:image file:_files' \
'(-x -y -z --root --root_t --root_s -f --file *)'{-z,--root_s}'[use image as the current desktop background, stretched]:image file:_files' \
@@ -22,6 +23,9 @@ _arguments -s \
'(-n --no_filter)'{-n,--no_filter}'[disable filtering of images by extension]' \
'(-i --no_statusbar -I --statusbar)'{-i,--no_statusbar}'[disable statusbar]' \
'(-i --no_statusbar -I --statusbar)'{-I,--statusbar}'[enable statusbar]' \
+ '(-J --showJPEGcomments)'{-J,--showJPEGcomments}'[enable display of JPEG comments]' \
+ '(-E --showArtistName)'{-E,--showArtistName}'[enable display of artist (author) name]' \
+ "--artist_ignore[don't show specified artist name]:artist" \
'(-p --transparency)'{-p,--transparency}'[enable transparency]' \
'(-a --do_grab)'{-a,--do_grab}'[grab the pointer in windowed mode]' \
'(-G --disable_grab)'{-G,--disable_grab}'[disable pointer grabbing in fullscreen mode]' \
@@ -47,4 +51,4 @@ _arguments -s \
'(-Y --source_profile)'{-Y,--source_profile}'[specify colour profile file as source profile]:colour profile file:_files' \
'(-Z --display_profile)'{-Z,--display_profile}'[specify colour profile file as display profile]:colour profile file:_files' \
'--vikeys[enable movement with h/j/k/l]' \
- '*:image file:_files -g "*.(#i)(bmp|eim|gif|ico|jp([eg]|eg)|pcx|png|p[pngb]m|pjpeg|svg|tif(|f)|wmf|x[pb]m)(-.)"'
+ '*:image file:_files -g "*.(#i)(bmp|eim|gif|hei[cf]|ico|jp([eg]|eg)|pcx|png|p[pngb]m|pjpeg|svg|tif(|f)|webp|wmf|x[pb]m)(-.)"'
diff --git a/Completion/X/Command/_setxkbmap b/Completion/X/Command/_setxkbmap
index 882a6f939..0850d5419 100644
--- a/Completion/X/Command/_setxkbmap
+++ b/Completion/X/Command/_setxkbmap
@@ -1,101 +1,119 @@
#compdef setxkbmap
-# TODO:
-# model, option, symbols and types suggestions
-# take -layout and -variant into account
-
-_setxkbmap() {
- emulate -L zsh
- setopt extendedglob
-
- # xkb files may be in different places depending on system
- local dir sourcedir fullname
- local -a searchdirs=(${XDG_DATA_HOME:-~/.local/share} ${(s.:.)XDG_DATA_DIRS:-/usr/lib:/usr/share:/usr/local/lib:/usr/local/share})
- for dir in $searchdirs; do
- fullname="$dir/X11/xkb"
- if [ -d $fullname ] ; then
- sourcedir=$fullname
- break
- fi
- done
- [ -d $sourcedir ] || return 1
-
- local -a arguments
-
- arguments=(
- '-compat[compatibility map]:compatibility:_setxkbmap_compat'
- '-config[configuration file]:configuration:_files'
- '-display[display]:display:_x_display'
- '-geometry[geometry component]:geometry:_setxkbmap_geometry'
- '-model[model name]:model:'
- '-option[xkb option]:option:'
- '(-)'-print'[print component names]'
- '-rules[rules file]:rules:_files'
- '-symbols[symbols components]:symbols:'
- '(-)'{-help,-h}'[display help message]'
- '-synch[force synchronization]'
- '-types[types components]:types:'
- '(-verbose -v)'{-verbose,-v}'[set verbosity level]:verbosity:(0 1 2 3 4 5 6 7 8 9)'
- '*::keyboard:_setxkbmap_dispatcher'
+local curcontext="$curcontext" sourcedir layout ret=1
+local -a state state_descr line expl matches suf
+local -A opt_args
+
+_arguments -C \
+ '(-)'{-\?,-help}'[display help message]' \
+ '-compat[compatibility map]:compatibility:->compatmaps' \
+ '-config[configuration file]:configuration:_files' \
+ '-device[specify numeric id of the input device]:device:->devices' \
+ '-display[display]:display:_x_display' \
+ '-geometry[geometry component]:geometry:->geometries' \
+ '*-I+[add a directory to be searched for layout or rules files]: :_directories' \
+ '-keycodes[specify keycodes component name]:name' \
+ '-keymap[specify keymap to load]:keymap' \
+ '-layout[specify layout used to choose component names]:layout:->layouts' \
+ '-model[specify model used to choose component names]:model:->models' \
+ '*-option[add an xkb option]:option:->options' \
+ '(-)'-print'[print a complete xkb_keymap description]' \
+ '-query[print the current layout settings]' \
+ '-rules[specify rules file to use]:rules:->rules' \
+ '-symbols[specify symbols component name]:symbol' \
+ '-synch[force synchronization]' \
+ '-types[types components]:type:->types' \
+ '(-verbose -v)'{-verbose,-v}'[set verbosity level]:verbosity:(0 1 2 3 4 5 6 7 8 9)' \
+ '(-)-version[display version information]' \
+ '-variant[specify layout variant used to choose component name]:variant:->variants' \
+ '1:layout:->layouts' \
+ '2:variant:->variants' \
+ '*:option:->options' && ret=0
+
+if [[ -n $state ]]; then
+ local open='(' close=')'
+ compquote open close
+
+ layout=${opt_args[-layout]:-$line[1]}
+ if [[ $state = layouts ]]; then
+ compset -P '*,'
+ if compset -P 1 '*\('; then
+ layout="${${IPREFIX%$open}##*,}"
+ state=variants state_descr=variant
+ suf=( -S"$close$compstate[quote] " )
+ else
+ suf=( -S$open -r ",('\" \t\n\-" )
+ fi
+ fi
+
+ _description $state expl $state_descr
+ if (( $+commands[localectl] )); then
+ case $state in
+ layouts) matches=( $(_call_program layouts localectl list-x11-keymap-layouts) ) ;;
+ models) matches=( $(_call_program layouts localectl list-x11-keymap-models) ) ;;
+ options) matches=( $(_call_program layouts localectl list-x11-keymap-options) ) ;;
+ variants) matches=( $(_call_program layouts localectl list-x11-keymap-variants $layout) ) ;;
+ esac
+ fi
+ if (( ! $#matches )); then
+ sourcedir=$(pkg-config xkeyboard-config --variable=xkb_base 2>/dev/null)
+ [[ -z $sourcedir ]] && sourcedir=(
+ ${XDG_DATA_HOME:-~/.local/share}/X11/xkb(N/)
+ ${(s.:.)XDG_DATA_DIRS:-/usr/lib:/usr/share:/usr/local/lib:/usr/local/share}/X11/xkb(N/)
)
- _arguments $arguments
-}
-
-_setxkbmap_dispatcher () {
-
- case $CURRENT in
- 1)
- _setxkbmap_layout
- ;;
- 2)
- _setxkbmap_variant "$words[1]"
- ;;
+ (( $#sourcedir )) && case $state in
+ layouts) matches=( $sourcedir/symbols/**/^README(.Ne."REPLY=\${REPLY#*/symbols/}".) ) ;;
+ compatmaps) matches=( $sourcedir/compat/^README(.:t) ) ;;
+ models) matches=( $(sed -n '/modelList/,/\/modelList/ s, *<name>\(.*\)</name>,\1,p' $sourcedir/rules/(evdev|base).xml(.N[1])) ) ;;
+ options) matches=( $(sed -n '/optionList/,/\/optionList/ s, *<name>\(.*\)</name>,\1,p' $sourcedir/rules/(evdev|base).xml(.N[1])) ) ;;
+ rules) matches=( $sourcedir/rules/*.lst(-.:t:r) ) ;;
+ types) matches=( $sourcedir/types/^README(.:t) ) ;;
+ variants)
+ [[ -n $layout && -r $sourcedir/symbols/$layout ]] && matches=(
+ ${${${(M)${(f)"$(<$sourcedir/symbols/$layout)"}:#*xkb_symbols*\"([^\"])##\"*}##*xkb_symbols([^\"])##\"}%%\"*}
+ )
+ ;;
+ geometries)
+ if compset -P 1 '*\('; then
+ layout="${${IPREFIX%$open}##*,}"
+ suf=( -S"$close$compstate[quote] " )
+ matches=( $(sed -n -e '/xkb_geometry/ s/[^"]*"\([^"]*\).*/\1/p' $sourcedir/geometry/${IPREFIX%%[\\(]#}(.N)) )
+ else
+ suf=( -S$open -r "('\" \t\n\-" )
+ matches=( $sourcedir/geometry/^README(.:t) )
+ fi
+ ;;
+ devices)
+ # copied from _xinput
+ if (( $+commands[xinput] )); then
+ local -a ids names disp
+ local out
+ ids=( ${${(f)"$(_call_program input-devices xinput list --id-only)"}#? } )
+ names=( ${${(f)"$(_call_program input-devices xinput list --name-only)"}#? } )
+ disp=( ${(f)"$(_call_program input-devices xinput list --short)"} )
+
+ if [[ $PREFIX$SUFFIX = [^-]*[^0-9]* ]]; then
+ # match based on the names but insert IDs
+ compadd "$expl[@]" -M 'b:=* m:{[:lower:]}={[:upper:]}' -D ids -D disp -a names
+ compadd "$expl[@]" -U -ld disp -a ids && ret=0
+
+ zstyle -s ":completion:${curcontext}:input-devices" insert-ids out || out=menu
+ case "$out" in
+ menu) compstate[insert]=menu ;;
+ single) [[ $#ids -ne 1 && $compstate[insert] != menu ]] &&
+ compstate[insert]= ;;
+ *) [[ ${#:-$PREFIX$SUFFIX} -gt ${#compstate[unambiguous]} ]] &&
+ compstate[insert]=menu ;;
+ esac
+ else
+ compadd "$expl[@]" -M 'B:0=' -o nosort -ld disp -a ids && ret=0
+ fi
+ fi
+ return ret
+ ;;
esac
-}
-
-_setxkbmap_files () {
- local dir="$1"
- local label="$2"
-
- local -a fullpath shortpath expl
-
- fullpath=($sourcedir/$dir/**/*~*README(.))
- shortpath=(${fullpath#$sourcedir\/$dir\/})
-
- _wanted layout expl $label compadd -a - shortpath
-
-}
-
-(( $+functions[_setxkbmap_compat] )) ||
-_setxkbmap_compat() {
- _setxkbmap_files "compat" "compatibility"
-}
-
-(( $+functions[_setxkbmap_layout] )) ||
-_setxkbmap_layout () {
- _setxkbmap_files "symbols" "layout"
-}
-
-(( $+functions[_setxkbmap_geometry] )) ||
-_setxkbmap_geometry () {
- _setxkbmap_files "geometry" "geometry"
-}
-
-(( $+functions[_setxkbmap_variant] )) ||
-_setxkbmap_variant () {
- local file=$sourcedir/symbols/${1}
- local -a variants lines expl
-
- if [ ! -f $file ]; then
- _message "no such layout: ${1}"
- return 1
- fi
-
- lines=("${(f)$(< ${file})}")
- variants=(${${${(M)lines:#*xkb_symbols*\"([^\"])##\"*}##*xkb_symbols([^\"])##\"}%%\"*})
-
- _wanted variant expl 'variant' compadd -a variants
-
-}
+ fi
+ compadd "$expl[@]" $suf -a matches && ret=0
+fi
-_setxkbmap "$@"
+return ret
diff --git a/Completion/X/Command/_xdvi b/Completion/X/Command/_xdvi
index c33e67bcc..ed5982bcc 100644
--- a/Completion/X/Command/_xdvi
+++ b/Completion/X/Command/_xdvi
@@ -2,15 +2,22 @@
_xt_arguments \
-+{allowshell,copy,expert,hush{,chars,checksums,specials},keep,l,no{ghostscript,grey,gssafer,makepk,postscript,scan},safer,thorough,underlink,version} \
- +{altfont,base,browser,cr,debug,density,gamma,gspalette,hl,icongeometry,interpreter,margin,mfmode,offsets,p,paper,shrink,S,sidemargin,topmargin,xoffset,yoffset,grid{1,2,3},mgs{,1,2,3,4,5}} \
+ +{altfont,background,bg,browser,cr,debug,density,dvispath,editor,gamma,gspalette,hl,icongeometry,interpreter,margin,mfmode,offsets,p,paper,shrink,S,sidemargin,topmargin,xoffset,yoffset,grid{1,2,3},mgs{,1,2,3,4,5}} \
'-altfont:default font' \
- '-base:base URL' \
+ -{bg,background}':color:_x_color' \
'-browser:WWW browser:_command_names -e' \
'-cr:cursor color:_x_color' \
- '-debug:debugging bitmask:((1\:bitmaps 2\:dvi\ translation 4\:pk\ reading 8\:batch\ operation 16\:events 32\:file\ opening 64\:PostScript\ communication 128\:Kpathsea\ statistics 256\:Kpathsea\ hash\ table\ lookups 512\:Kpathsea\ path\ definitions 1024\:Kpathsea\ path\ expansion 2048\:Kpathsea\ searches))' \
+ '-debug:debugging bitmask:((1\:bitmaps 2\:dvi\ translation 4\:pk\ reading 8\:batch\ operation 16\:events 32\:file\ opening 64\:PostScript\ communication 128\:Kpathsea\ statistics 256\:Kpathsea\ hash\ table\ lookups 512\:Kpathsea\ path\ definitions 1024\:Kpathsea\ path\ expansion 2048\:Kpathsea\ searches ))' \
'-density:font shrink density' \
+ '-dvispath:dvips program:_command_names -e' \
+ '-editor:text editor:_cmdstring' \
+ '-expertmode:display bitmask:((1\:statusline 2\:scrollbars 4\:pagelist 8\:toolbar 16\:menubar))' \
+ -{fg,foreground}':color:_x_color' \
+ '-findstring:string' \
+ '-font:font:_x_font' \
+ '-fullscreen' \
'-gamma:anti-aliasing factor [1.0]' \
- -grid{1,2,3}':grid color:_x_color' \
+ '-gsalpha' \
'-gspalette:Ghostscript palette:(Color Greyscale Monochrome)' \
'-hl:page highlight color:_x_color' \
'-icongeometry:icon geometry:_x_geometry' \
@@ -21,6 +28,9 @@ _xt_arguments \
'-offsets:offset size' \
'-p:font size (pixel per inch)' \
'-paper:paper size (<width>x<height> or ...):(us usr legal foolscap a1 a2 a3 a4 a5 a6 a7 b1 b2 b3 b4 b5 b6 b7 c1 c2 c3 c4 c5 c6 c7 a1r a2r a3r a4r a5r a6r a7r)' \
+ '-ps2pdfpath:ps2pdf program:_command_names -e' \
+ '-rulecolor:color' \
+ '-rv' \
'-shrink:shrink factor' \
'-S:font shrink density' \
'-sidemargin:side margin' \
diff --git a/Completion/X/Command/_zeal b/Completion/X/Command/_zeal
index 334331d40..024b8c381 100644
--- a/Completion/X/Command/_zeal
+++ b/Completion/X/Command/_zeal
@@ -8,6 +8,7 @@ _arguments -S \
':query:->queries' \
+ '(opt)' \
{-h,--help}'[display help information]' \
+ --help-all'[display help, including generic Qt options]' \
{-v,--version}'[display version information]' \
{-f,--force}'[force the application to run]' && ret=0