diff options
Diffstat (limited to 'Completion/X')
-rw-r--r-- | Completion/X/Command/_urxvt | 83 | ||||
-rw-r--r-- | Completion/X/Command/_xclip | 25 | ||||
-rw-r--r-- | Completion/X/Type/_xft_fonts | 2 |
3 files changed, 73 insertions, 37 deletions
diff --git a/Completion/X/Command/_urxvt b/Completion/X/Command/_urxvt index af227552a..b7ea06be5 100644 --- a/Completion/X/Command/_urxvt +++ b/Completion/X/Command/_urxvt @@ -1,39 +1,72 @@ -#compdef urxvt +#compdef rxvt urxvt urxvtc + +local curcontext="$curcontext" state line expl +local -a suf long_args +typeset -A opt_args +typeset -U extensions + +[[ -prefix -- ]] || zstyle -T ":completion:${curcontext}:options" prefix-needed && + : ${(A)long_args:=${${${${${${${(M)${(f)"$(urxvt --help 2>&1)"}:# *:*}/ /--}// /}/fontname/fontname:->fonts}/:color/:color:_x_color}/boolean/boolean:(true false)}/:(searchpath|file)/:path:_files}} _x_arguments \ - -+{rv,ls,j,ptab,sb,sr,st,si,sk,sw,ip,ipf,ut,vb,tcw,insecure,uc,bc,pb,bl,ssc,ssr} \ - '-tn:terminal type:' \ + -+{rv,ls,j,ss,ptab,sb,sr,st,si,sk,sw,ip,tr,ut,vb,tcw,insecure,uc,bc,pb,is,override-redirect,hold,bl,sbg,ssc,ssr} \ + '-tn[specify value of TERM]:terminal type:_terminals' \ '-C[intercept console messages]' \ '-iconic[start iconic]' \ - '-sbt[scroll bar thickness]:pixels:' \ + '-cd[start shell in specific directory]:directory:_files -/' \ + '-sbt[scroll bar thickness]:pixels' \ '-tint[tint color]:color:_x_color' \ - '-fade[make colors darker when losing focus]:percentage:' \ - '-sh[shade background when tinting]:percentage:' \ - '-bg:background color:_x_color' \ - '-fg:foreground color:_x_color' \ - '-cr:cursor color:_x_color' \ - '-pr:pointer color:_x_color' \ - '-pr2:pointer background color:_x_color' \ - '-bd:border color:_x_color' \ + '-fade[make colors darker when losing focus]:percentage' \ + '-fadecolor[specify target color for off-focus fading]:color:_x_color' \ + '-sh[shade background when tinting]:percentage' \ + '-bg[background color]:color:_x_color' \ + '-fg[foreground color]:color:_x_color' \ + '-hc[highlight color]:color:_x_color' \ + '-cr[cursor color]:color:_x_color' \ + '-pr[pointer color]:color:_x_color' \ + '-pr2[pointer background color]:color:_x_color' \ + '-bd[border color]:color:_x_color' \ '-pixmap:pixmap:_files' \ - '-fn:normal font:_x_font' \ - '-fb:bold font:_x_font' \ - '-fi:italic font:_x_font' \ - '-fbi:bold italic font:_x_font' \ + '-icon[specify icon image]:image file:_files' \ + '-fn:normal font:->fonts' \ + '-fb:bold font:->fonts' \ + '-fi:italic font:->fonts' \ + '-fbi:bold italic font:->fonts' \ '-im:input method:(SCIM)' \ + '-pe[enable perl extension]:perl extension:->extensions' \ '-pt:input style:(OverTheSpot OffTheSpot Root)' \ '-imlocale:locale input method:_locales' \ '-imfont:fontset for styles OverTheSpot and OffTheSpot:_x_font' \ - '-name:client instance, icon, and title strings:' \ - '-title:title name for window:' \ - '-n:icon name for window:' \ - '-sl:save lines:' \ + '-name:client instance, icon, and title strings' \ + '(-T -title)'{-T,-title}':title name for window' \ + '-n:icon name for window' \ + '-sl:save lines' \ '-embed:window id to embed terminal in:_x_window' \ - '-pty-fd:file descriptor of pty to use:' \ - '-w:external border in pixels:' \ - '-b:internal border in pixels:' \ - '-lsp:number of extra pixels between rows:' \ + '-pty-fd:file descriptor of pty to use' \ + '-w:external border in pixels' \ + '-b:internal border in pixels' \ + '-lsp:number of extra pixels between rows' \ + '-letsp:letter spacing adjustment' \ '-mod:meta modifier:_x_modifier' \ '-e:program: _command_names -e:*::program arguments: _normal' \ '-help[print help]' \ - '--help[list long options]' + '--help[list long options]' $long_args && ret=0 + +case $state in + fonts) + if compset -P xft:; then + _xft_fonts && ret=0 + else + _x_font && ret=0 + fi + ;; + extensions) + compset -S ',*' || suf=( -qS , ) + compset -P '*,'; compset -P - + extensions=( {$commands[urxvt]:h:h,/usr,/usr/local}/lib{,64}/urxvt/perl(N) ) + _wanted extensions expl 'perl extension' compadd $suf[@] default \ + $extensions/*(:t) && ret=0 + ;; +esac + +return ret diff --git a/Completion/X/Command/_xclip b/Completion/X/Command/_xclip index 759251c28..ff131f3b1 100644 --- a/Completion/X/Command/_xclip +++ b/Completion/X/Command/_xclip @@ -1,14 +1,17 @@ #compdef xclip _arguments \ - '(-i -in -o -out)'{-i,-in}'[Read text into X selection]' \ - '(-i -in -o -out)'{-o,-out}'[Print selection to standard out]' \ - {-l,-loops}'[Number of selection requests to wait before exiting]:number:' \ - {-d,-display}'[X display to connect to]:X11 display:' \ - '(-)'{-h,-help}'[Usage information]' \ - '(-selection)-selection[Selection to access]:selection:(primary secondary clipboard buffer-cut)' \ - $'-noutf8[Use old Unicode, don\'t treat text as UTF-8]' \ - '(-)-version[version information]' \ - '(-quiet -verbose)-silent[Errors only, run in background]' \ - $'(-silent -verbose)-quiet[Run in foreground, show what\'s happening]' \ - '(-silent -quiet)-verbose[Running commentary]' + '(-i -in -o -out)'{-i,-in}'[read text into X selection (default)]' \ + '(* -i -in -o -out)'{-o,-out}'[print selection to standard output]' \ + '(-o -out -f -filter -quiet)'{-f,-filter}'[copy input additionally to standard output]' \ + {-l,-loops}'[number of selection requests to wait before exiting]:number' \ + {-t,-target}'[specify data format]:format:($(_call_program targets xclip -o -t TARGETS))' \ + {-d,-display}'[X display to connect to]:display:_x_display' \ + '(-)'{-h,-help}'[display usage information]' \ + '(-selection)-selection[selection to access]:selection:(primary secondary clipboard buffer-cut)' \ + "-noutf8[operate in legacy, non-Unicode, mode]" \ + '(-)-version[display version information]' \ + '(-quiet -verbose)-silent[errors only, run in background]' \ + "(-silent -verbose)-quiet[run in foreground, show what's happening]" \ + '(-silent -quiet)-verbose[running commentary]' \ + '(-o -out)*:input file:_files' diff --git a/Completion/X/Type/_xft_fonts b/Completion/X/Type/_xft_fonts index 0d5f56fe5..535b9b5ae 100644 --- a/Completion/X/Type/_xft_fonts +++ b/Completion/X/Type/_xft_fonts @@ -37,7 +37,7 @@ elif compset -P '*[^\\]-'; then _message -e size 'point size' && ret=0 else _wanted fonts expl font compadd "$suf[@]" \ - ${${(f)"$(_call_program fonts fc-list 2>/dev/null)"//,/$'\n'}%%:*} && ret=0 + ${(us:,:)$(_call_program fonts fc-list -f '%\{family\},' 2>/dev/null)} && ret=0 fi return ret |