diff options
Diffstat (limited to 'Completion/X')
-rw-r--r-- | Completion/X/Command/.distfiles | 1 | ||||
-rw-r--r-- | Completion/X/Command/_mplayer | 6 | ||||
-rw-r--r-- | Completion/X/Command/_xclip | 14 | ||||
-rw-r--r-- | Completion/X/Command/_xterm | 1 | ||||
-rw-r--r-- | Completion/X/Type/.distfiles | 1 | ||||
-rw-r--r-- | Completion/X/Type/_xft_fonts | 43 |
6 files changed, 63 insertions, 3 deletions
diff --git a/Completion/X/Command/.distfiles b/Completion/X/Command/.distfiles index 3b6dc49fa..c6835ea54 100644 --- a/Completion/X/Command/.distfiles +++ b/Completion/X/Command/.distfiles @@ -20,6 +20,7 @@ _urxvt _vnc _x_utils _xauth +_xclip _xdvi _xfig _xloadimage diff --git a/Completion/X/Command/_mplayer b/Completion/X/Command/_mplayer index 85c4f6d12..81669fc1c 100644 --- a/Completion/X/Command/_mplayer +++ b/Completion/X/Command/_mplayer @@ -115,12 +115,12 @@ case "$state" in _tags files urls while _tags; do _requested files expl 'video file' _files -g \ - "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|webm|wma|wmv)(-.)" && ret=0 + "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|webm|wma|wmv)(-.)" && ret=0 if _requested urls; then while _next_label urls expl URL; do _urls "$expl[@]" && ret=0 - compadd -S '' "$expl[@]" {dvd,vcd,cdda,cddb,tv}:// && ret=0 - done + compadd -S '' "$expl[@]" {dvd,vcd,cdda,cddb,tv}:// && ret=0 + done fi (( ret )) || return 0 done diff --git a/Completion/X/Command/_xclip b/Completion/X/Command/_xclip new file mode 100644 index 000000000..759251c28 --- /dev/null +++ b/Completion/X/Command/_xclip @@ -0,0 +1,14 @@ +#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]' diff --git a/Completion/X/Command/_xterm b/Completion/X/Command/_xterm index a246ab48e..7619b280a 100644 --- a/Completion/X/Command/_xterm +++ b/Completion/X/Command/_xterm @@ -9,6 +9,7 @@ _xt_arguments \ '-cc:character class:' \ '-cr:text cursor color:_x_color' \ '-e:program: _command_names -e:*::program arguments: _normal' \ + '-fa:font pattern:_xft_fonts' \ '-fb:bold font:_x_font' \ '-fi:icon font:_x_font' \ '-hc:background color for highlighted text:_x_color' \ diff --git a/Completion/X/Type/.distfiles b/Completion/X/Type/.distfiles index 364e4e6e6..fa5c16ce0 100644 --- a/Completion/X/Type/.distfiles +++ b/Completion/X/Type/.distfiles @@ -6,4 +6,5 @@ _x_colormapid _x_keysym _x_title _x_cursor _x_locale _x_window _x_display _x_modifier _xt_session_id _x_extension _x_name _x_visual +_xft_fonts ' diff --git a/Completion/X/Type/_xft_fonts b/Completion/X/Type/_xft_fonts new file mode 100644 index 000000000..0d5f56fe5 --- /dev/null +++ b/Completion/X/Type/_xft_fonts @@ -0,0 +1,43 @@ +#compdef fc-list fc-match + +local -a suf +local font=${${PREFIX//-[0-9]##:/:}%:*}: ret=1 +local attr + +compset -S ':*' || suf=( -S: -r "-: \t\n\-" ) +if compset -P '*:'; then + attr="${PREFIX%\=*}" + if compset -P '*='; then + case $attr in + hintstyle) + _wanted value expl 'value' compadd "$suf[@]" \ + hint{none,slight,medium,full} && ret=0 + ;; + *) + _wanted value expl 'value' compadd "$suf[@]" \ + ${${(f)"$(_call_program font-attrs + fc-list $font $attr 2>/dev/null)"//,/$'\n'}##*=} && ret=0 + ;; + esac + else + _tags elements {weight,slant}-constants + while _tags; do + _requested elements expl element compadd -qS= hintstyle hinting autohint \ + size ${${(u)${(M)${(f)"$(_call_program elements + fc-list -v $font 2>/dev/null)"}:# [a-z]*}%%:*}#?} && ret=0 + _requested weight-constants expl 'weight constant' compadd "$suf[@]" \ + thin bold regular medium semibold heavy roman && ret=0 + _requested slant-constants expl 'slant constant' compadd "$suf[@]" \ + roman italic oblique && ret=0 + + (( ret )) || break + done + fi +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 +fi + +return ret |