1 #compdef i3lock 2 3 _i3lock() { 4 integer ret=1 5 local -a args 6 zstyle ':completion:*:*:i3lock:*:descriptions' format '' 7 args+=( 8 "(--version -v)"{--version,-v}"[Display the version of i3lock]" 9 "(--nofork -n)"{--nofork,-n}"[Don't fork after starting]" 10 "(--beep -b)"{--beeping,-b}"[Enable beeping]" 11 "(--no-unlock-indicator -u)"{--no-unlock-indicator,-u}"[Disable the unlock indicator]" 12 "(--image -i)"{--image,-i}"[Display the given PNG image instead of a blank screen]:filename:_files -g '*.(png|jpg)'" 13 "--raw[Read the image given by --image as a raw image instead of PNG]:raw:" 14 "(--color -c)"{--color,-c}"[Turn the screen into the given hex color]:hex:->hex" 15 "(--tiling -t)"{--tiling,-t}"[Image will be displayed tiled all over the screen]" 16 "(--centered -C)"{--centered,-C}"[Image will be displayed centered on the screen]" 17 "(--fill -F)"{--fill,-F}"[Image will fill all over the screen]" 18 "(--max -M)"{--max,-M}"[Image will fit the screen at width or height]" 19 "(--scale -L)"{--scale,-L}"[Image will be stretched on the screen]" 20 "(--pointer -p)"{--pointer,-p}"[Sets mouse pointer type]:pointer:(win default)" 21 "(--ignore-empty-password -e)"{--ignore-empty-password,-e}"[Do not validate empty password]" 22 "(--show-failed-attempts -f)"{--show-failed-attempts,-f}"[Show the number of failed attemps]" 23 "--debug[Enables debug logging.]" 24 25 # i3lock-color OPTIONS 26 27 "(--screen -S)"{--screen,-S}"[Specifies which display to draw the unlock indicator]:int:" 28 "(--blur -B)"{--blur,-B}"[Captures the screen and blurs it using the given sigma]:sigma:" 29 "(--clock --force-clock -k)"{--clock,--force-clock,-k}"[Displays the clock]" 30 "--indicator[Forces the indicator to always be visible]" 31 "--radius[The radius of the circle]:float:" 32 "--ring-width[The width of the ring unlock indicator]:float:" 33 # Colors 34 "--inside-color[Sets the default \"resting\" color for the interior circle]:hex:->hex" 35 "--ring-color[Sets the default ring color]:hex:->hex" 36 "--insidever-color[Sets the interior circle color while the password is being verified]:hex:->hex" 37 "--ringver-color[Sets the ring color while the password is being verified]:hex:->hex" 38 "--insidewrong-color[Sets the interior circle color for suring flash for an incorrect password]:hex:->hex" 39 "--ringwrong-color[Sets the ring color during the flas for an incorrect password]:hex:->hex" 40 "--line-color[Sets the color for the line separating the inside circle, and the outer ring]:hex:->hex" 41 "--line-uses-inside[Conflicts with --line-uses-ring. Overrides --linecolor; the line will match the inside color]" 42 "--line-uses-ring[Conflicts with --line-uses-inside. Overrides --linecolor; The line will match the ring color]" 43 "--keyhl-color[Sets the color of the ring 'highlight' strokes that appear upon keypress]:hex:->hex" 44 "--bshl-color[Sets the color of the ring 'highlight' strokes that appear upon backspace]:hex:->hex" 45 "--separator-color[Sets the color of the 'separator', which is at both ends of the ring highlights]:hex:->hex" 46 "--verif-color[Sets the color of the status text while verifying]:hex:->hex" 47 "--wrong-color[Sets the color of the status when \"wrong\"]:hex:->hex" 48 "--modif-color[Sets the color of the status text while verifying]:hex:->hex" 49 "--layout-color[Sets the color of the keyboard layout text]:hex:->hex" 50 "--time-color[Sets te color of the time in the clock]:hex:->hex" 51 "--date-color[Sets the color of the date in the clock]:hex:->hex" 52 "--greeter-color[Sets the color of the greeter text]:hex:->hex" 53 # Text 54 "--time-str[Sets the format used for generating the time string]:str:" 55 "--date-str[Sets the format used for generating the date string]:str:" 56 "--verif-text[Sets the string to be shown while verifying]:str:" 57 "--wrong-text[Sets the string to be shown upon entering an incorrect password]:str:" 58 "--keylayout[Displays the keylayout]:mode:((0\:'Displays the full string returned by the query, i.e. English (US)' 1\:'Displays up until the first parenthesis, i.e. English' 2\:'Displays just the contents of the parenthesis, i.e US'))" 59 "--noinput-text[Sets the string to be shown upon pressing backspace whithout anything to delete]:str:" 60 "--lock-text[Sets the string to be shown while acquiring pointer and keyboard focus]:str:" 61 "--lockfailed-text[Sets the string to be shown after failing to acquire pointer and keyboard focus]:str:" 62 "--greeter-text[Sets the greeter text]:str:" 63 "--no-modkey-text[Hides the modkey indicator]" 64 # Align 65 "(--time-align --date-align --layout-align --verif-align --wrong-align --modif-align --greeter-align)"{--time-align,--date-align,--layout-align,--verif-align,--wrong-align,--modif-align,--greeter-align}"[Sets the text alignment]:alignment:((0\:'default' 1\:'left aligned' 2\:'right aligned'))" 66 # Outline color 67 "(--timeoutline-color --dateoutline-color --layoutoutline-color --verifoutline-color --wrongoutline-color --modifoutline-color --greeteroutline-color)"{--timeoutline-color,--dateoutline-color,--layoutoutline-color,--verifoutline-color,--wrongoutline-color,--modifoutline-color,--greeteroutline-color}"[Sets the color of the outline]:hex:->hex" 68 # Fonts 69 "(--time-font --date-font --layout-font --verif-font --wrong-font --greeter-font)"{--time-font,--date-font,--layout-font,--verif-font,--wrong-font,--greeter-font}"[Sets the font used to render various strings]:str:" 70 # Size 71 "(--time-size --date-size --layout-size --verif-size --wrong-size --greeter-size)"{--time-size,--date-size,--layout-size,--verif-size,--wrong-size,--greeter-size}"[Sets the font size used to render various strings]:int:" 72 # Outline width 73 "(--timeoutline-width --dateoutline-width --layoutoutline-width --verifoutline-width --wrongoutline-width --modifieroutline-width --greeteroutline-width)"{--timeoutline-width,--dateoutline-width,--layoutoutline-width,--verifoutline-width,--wrongoutline-width,--modifieroutline-width,--greeteroutline-width}"[Sets the width of the outline]:float:" 74 # Position 75 "--ind-pos[Sets the position for the unlock indicator]:pos:->ind_pos" 76 "--time-pos[Sets the position for the time string]:pos:->time_pos" 77 "--date-pos[Sets the position for the date string]:pos:->date_pos" 78 "--greeter-pos[Sets the position for the greeter string]:pos:->greeter_pos" 79 # Media keys 80 "--pass-media-keys[Allow media keys to be used while the screen is locked]" 81 "--pass-screen-keys[Allow screen keys to be used while the screen is locked]" 82 "--pass-power-keys[Allow power keys to be used while the screen is locked]" 83 "--pass-volume-keys[Allow volume keys to be used while the screen is locked]" 84 "--custom-key-commands[Enable shell commands for media keys]" 85 "--cmd-brightness-up[Command for XF86MonBrightnessUp]" 86 "--cmd-brightness-down[Command for XF86MonBrightnessDown]" 87 "--cmd-media-play[Command for XF86AudioPlay]" 88 "--cmd-media-pause[Command for XF86AudioPause]" 89 "--cmd-media-stop[Command for XF86AudioStop]" 90 "--cmd-media-next[Command for XF86AudioNext]" 91 "--cmd-media-prev[Command for XF86AudioPrev]" 92 "--cmd-audio-mute[Command for XF86AudioMute]" 93 "--cmd-volume-up[Command for XF86AudioRaiseVolume]" 94 "--cmd-volume-down[Command for XF86AudioLowerVolume]" 95 "--cmd-mic-mute[Command for XF86AudioMicMute]" 96 "--cmd-power-down[Command for XF86PowerDown]" 97 "--cmd-power-off[Command for XF86PowerOff]" 98 "--cmd-power-sleep[Command for XF86Sleep]" 99 # Bar mode 100 "--bar-indicator[Replaces the usual ring indicator with a bar indicator]" 101 "--bar-direction[Sets the direction the bars grow in]:direction:((0\:'default' 1\:'reverse' 2\:'both'))" 102 "--bar-orientation[Sets whether the bar is vertically or horizontally oriented]:orientation:(vertical horizontal)" 103 "--bar-step[Sets the step that each bar decreases by when a key is pressed]:int:" 104 "--bar-max-height[The maximum height a bar can get to]:float:" 105 "--bar-base-width[The thickness of the \"base\" bar that all the bar originate from]:float:" 106 "--bar-color[Sets the default color of the bar base]:hex:->hex" 107 "--bar-periodic-step[The value by which the bars decrease each time the screen is redrawn]:int:" 108 "--bar-pos[Sets the bar position]:pos:->bar_pos" 109 "--bar-count[Sets the number of minibars to draw on each screen]:int:" 110 "--bar-total-width[The total width of the bar]:float:" 111 # Extra configs 112 "--redraw-thread[Starts a separate thread for redrawing the screen]" 113 "--refresh-rate[The refresh rate of the indicator]:double:" 114 "--composite" 115 "--no-verify[Do not verify the password provided by the user and unlock inmediately]" 116 # Slideshow 117 "--slideshow-interval[The interval to wait until switching to the nex image]:double:" 118 "--slideshow-random-selection[Randomize the order of the images]" 119 120 121 ) 122 _arguments $args[@] && ret=0 123 124 case "$state" in 125 hex) 126 zstyle ':completion:*:*:i3lock:*:descriptions' format '%d' 127 _message "Color in hexadecimal rrggbbaa, like #ff0000ff or #354F9AFF" 128 ;; 129 ind_pos) 130 zstyle ':completion:*:*:i3lock:*:normal' format '%d' 131 zstyle ':completion:*:*:i3lock:*:descriptions' format '%B%d%b' 132 133 _message "\"x position:y position\"" 134 _message -e "normal" "'x' - x position of the current display. Corresponds to the left-most row of pixels" 135 _message -e "normal" "'y' - y position of the current display. Corresponds to the topmost row of pixels" 136 _message -e "normal" "'w' - width of the current display" 137 _message -e "normal" "'w' - height of the current display" 138 _message -e "normal" "'r' - unlock indicator radius" 139 ;; 140 time_pos) 141 zstyle ':completion:*:*:i3lock:*:normal' format '%d' 142 zstyle ':completion:*:*:i3lock:*:descriptions' format '%B%d%b' 143 144 _message "\"x position:y position\"" 145 _message -e "normal" "All the variables from --ind-pos may be used, in addition to:" 146 _message -e "normal" "'ix' - x position of the indicator on the current display" 147 _message -e "normal" "'iy' - y position of the indicator on the current display" 148 _message -e "normal" "If the --bar-indicator option is used, the following may be used" 149 _message -e "normal" "'bw' - width od the bar indicator" 150 _message -e "normal" "'bx' - x position of the bar indicator on the current display" 151 _message -e "normal" "'by' - y position of the bar indicator on the current display" 152 ;; 153 date_pos) 154 zstyle ':completion:*:*:i3lock:*:normal' format '%d' 155 zstyle ':completion:*:*:i3lock:*:descriptions' format '%B%d%b' 156 157 _message "\"x position:y position\"" 158 _message -e "normal" "All the variables from --ind-pos and --time-pos may be used, in addition to:" 159 _message -e "normal" "'tx' - x position of the timestring on the current display" 160 _message -e "normal" "'ty' - y position of the timestring on the current display" 161 ;; 162 greeter_pos) 163 zstyle ':completion:*:*:i3lock:*:normal' format '%d' 164 zstyle ':completion:*:*:i3lock:*:descriptions' format '%B%d%b' 165 166 _message "\"x position:y position\"" 167 _message -e "normal" "All the variables from --ind-pos and --time-pos may be used" 168 ;; 169 bar_pos) 170 zstyle ':completion:*:*:i3lock:*:normal' format '%d' 171 zstyle ':completion:*:*:i3lock:*:descriptions' format '%B%d%b' 172 173 _message "\"x position:y position\"" 174 _message -e "normal" "All the variables from --ind-pos and --time-pos may be used" 175 _message -e "normal" "If only one number is provided, sets the vertical offset from the top or left edge" 176 _message -e "normal" "If two numbers are provided, sets the starting position of the bar" 177 ;; 178 179 180 esac 181 182 return ret 183 } 184 185 _i3lock
