diff options
| -rw-r--r-- | dmenu.1 | 88 | ||||
| -rw-r--r-- | dmenu.c | 19 |
2 files changed, 88 insertions, 19 deletions
| @@ -33,7 +33,7 @@ matching the tokens in the input. | |||
| 33 | .B dmenu_run | 33 | .B dmenu_run |
| 34 | is a script used by | 34 | is a script used by |
| 35 | .IR dwm (1) | 35 | .IR dwm (1) |
| 36 | which lists programs in the user's $PATH and executes the selected item. | 36 | which lists programs in the user's $PATH and runs the result in their $SHELL. |
| 37 | .SH OPTIONS | 37 | .SH OPTIONS |
| 38 | .TP | 38 | .TP |
| 39 | .B \-b | 39 | .B \-b |
| @@ -73,28 +73,90 @@ defines the selected foreground color. | |||
| 73 | .B \-v | 73 | .B \-v |
| 74 | prints version information to stdout, then exits. | 74 | prints version information to stdout, then exits. |
| 75 | .SH USAGE | 75 | .SH USAGE |
| 76 | dmenu is completely controlled by the keyboard. Besides standard Unix line | 76 | dmenu is completely controlled by the keyboard. Items are selected using the |
| 77 | editing and item selection (arrow keys, page up/down, home and end), the | 77 | arrow keys, page up, page down, home, and end. |
| 78 | following keys are recognized: | ||
| 79 | .TP | 78 | .TP |
| 80 | .B Tab (Ctrl\-i) | 79 | .B Tab |
| 81 | Copy the selected item to the input field. | 80 | Copy the selected item to the input field. |
| 82 | .TP | 81 | .TP |
| 83 | .B Return (Ctrl\-j) | 82 | .B Return |
| 84 | Confirm selection. Prints the selected item to stdout and exits, returning | 83 | Confirm selection. Prints the selected item to stdout and exits, returning |
| 85 | success. | 84 | success. |
| 86 | .TP | 85 | .TP |
| 87 | .B Shift\-Return (Ctrl\-Shift\-j) | 86 | .B Shift\-Return |
| 88 | Confirm input. Prints the input text to stdout and exits, returning success. | 87 | Confirm input. Prints the input text to stdout and exits, returning success. |
| 89 | .TP | 88 | .TP |
| 90 | .B Escape (Ctrl\-c) | 89 | .B Escape |
| 91 | Exit without selecting an item, returning failure. | 90 | Exit without selecting an item, returning failure. |
| 92 | .TP | 91 | .TP |
| 93 | .B Ctrl\-y | 92 | C\-a |
| 94 | Paste the primary X selection into the input field. | 93 | Home |
| 95 | .TP | 94 | .TP |
| 96 | .B Ctrl-Shift-y | 95 | C\-b |
| 97 | Paste the X clipboard into the input field. | 96 | Left |
| 97 | .TP | ||
| 98 | C\-c | ||
| 99 | Escape | ||
| 100 | .TP | ||
| 101 | C\-d | ||
| 102 | Delete | ||
| 103 | .TP | ||
| 104 | C\-e | ||
| 105 | End | ||
| 106 | .TP | ||
| 107 | C\-f | ||
| 108 | Right | ||
| 109 | .TP | ||
| 110 | C\-h | ||
| 111 | Backspace | ||
| 112 | .TP | ||
| 113 | C\-i | ||
| 114 | Tab | ||
| 115 | .TP | ||
| 116 | C\-j | ||
| 117 | Return | ||
| 118 | .TP | ||
| 119 | C\-k | ||
| 120 | Delete line right | ||
| 121 | .TP | ||
| 122 | C\-m | ||
| 123 | Return | ||
| 124 | .TP | ||
| 125 | C\-n | ||
| 126 | Down | ||
| 127 | .TP | ||
| 128 | C\-p | ||
| 129 | Up | ||
| 130 | .TP | ||
| 131 | C\-u | ||
| 132 | Delete line left | ||
| 133 | .TP | ||
| 134 | C\-w | ||
| 135 | Delete word left | ||
| 136 | .TP | ||
| 137 | C\-y | ||
| 138 | Paste from primary X selection | ||
| 139 | .TP | ||
| 140 | C\-Y | ||
| 141 | Paste from X clipboard | ||
| 142 | .TP | ||
| 143 | M\-g | ||
| 144 | Home | ||
| 145 | .TP | ||
| 146 | M\-G | ||
| 147 | End | ||
| 148 | .TP | ||
| 149 | M\-h | ||
| 150 | Page up | ||
| 151 | .TP | ||
| 152 | M\-j | ||
| 153 | Up | ||
| 154 | .TP | ||
| 155 | M\-k | ||
| 156 | Down | ||
| 157 | .TP | ||
| 158 | M\-l | ||
| 159 | Page down | ||
| 98 | .SH SEE ALSO | 160 | .SH SEE ALSO |
| 99 | .IR dwm (1), | 161 | .IR dwm (1), |
| 100 | .IR lsx (1) | 162 | .IR stest (1) |
| @@ -243,11 +243,8 @@ keypress(XKeyEvent *ev) { | |||
| 243 | len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status); | 243 | len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status); |
| 244 | if(status == XBufferOverflow) | 244 | if(status == XBufferOverflow) |
| 245 | return; | 245 | return; |
| 246 | if(ev->state & ControlMask) { | 246 | if(ev->state & ControlMask) |
| 247 | KeySym lower, upper; | 247 | switch(ksym) { |
| 248 | |||
| 249 | XConvertCase(ksym, &lower, &upper); | ||
| 250 | switch(lower) { | ||
| 251 | case XK_a: ksym = XK_Home; break; | 248 | case XK_a: ksym = XK_Home; break; |
| 252 | case XK_b: ksym = XK_Left; break; | 249 | case XK_b: ksym = XK_Left; break; |
| 253 | case XK_c: ksym = XK_Escape; break; | 250 | case XK_c: ksym = XK_Escape; break; |
| @@ -281,7 +278,17 @@ keypress(XKeyEvent *ev) { | |||
| 281 | default: | 278 | default: |
| 282 | return; | 279 | return; |
| 283 | } | 280 | } |
| 284 | } | 281 | else if(ev->state & Mod1Mask) |
| 282 | switch(ksym) { | ||
| 283 | case XK_g: ksym = XK_Home; break; | ||
| 284 | case XK_G: ksym = XK_End; break; | ||
| 285 | case XK_h: ksym = XK_Prior; break; | ||
| 286 | case XK_j: ksym = XK_Up; break; | ||
| 287 | case XK_k: ksym = XK_Down; break; | ||
| 288 | case XK_l: ksym = XK_Next; break; | ||
| 289 | default: | ||
| 290 | return; | ||
| 291 | } | ||
| 285 | switch(ksym) { | 292 | switch(ksym) { |
| 286 | default: | 293 | default: |
| 287 | if(!iscntrl(*buf)) | 294 | if(!iscntrl(*buf)) |
