diff options
| -rw-r--r-- | st.1 | 7 | ||||
| -rw-r--r-- | st.c | 34 |
2 files changed, 26 insertions, 15 deletions
| @@ -10,6 +10,8 @@ st \- simple terminal | |||
| 10 | .IR font ] | 10 | .IR font ] |
| 11 | .RB [ \-g | 11 | .RB [ \-g |
| 12 | .IR geometry ] | 12 | .IR geometry ] |
| 13 | .RB [ \-n | ||
| 14 | .IR name ] | ||
| 13 | .RB [ \-o | 15 | .RB [ \-o |
| 14 | .IR iofile ] | 16 | .IR iofile ] |
| 15 | .RB [ \-T | 17 | .RB [ \-T |
| @@ -32,6 +34,8 @@ st \- simple terminal | |||
| 32 | .IR font ] | 34 | .IR font ] |
| 33 | .RB [ \-g | 35 | .RB [ \-g |
| 34 | .IR geometry ] | 36 | .IR geometry ] |
| 37 | .RB [ \-n | ||
| 38 | .IR name ] | ||
| 35 | .RB [ \-o | 39 | .RB [ \-o |
| 36 | .IR iofile ] | 40 | .IR iofile ] |
| 37 | .RB [ \-T | 41 | .RB [ \-T |
| @@ -68,6 +72,9 @@ for further details. | |||
| 68 | .B \-i | 72 | .B \-i |
| 69 | will fixate the position given with the -g option. | 73 | will fixate the position given with the -g option. |
| 70 | .TP | 74 | .TP |
| 75 | .BI \-n " name" | ||
| 76 | defines the window instance name (default $TERM). | ||
| 77 | .TP | ||
| 71 | .BI \-o " iofile" | 78 | .BI \-o " iofile" |
| 72 | writes all the I/O to | 79 | writes all the I/O to |
| 73 | .I iofile. | 80 | .I iofile. |
| @@ -524,14 +524,15 @@ static int cmdfd; | |||
| 524 | static pid_t pid; | 524 | static pid_t pid; |
| 525 | static Selection sel; | 525 | static Selection sel; |
| 526 | static int iofd = 1; | 526 | static int iofd = 1; |
| 527 | static char **opt_cmd = NULL; | 527 | static char **opt_cmd = NULL; |
| 528 | static char *opt_io = NULL; | ||
| 529 | static char *opt_title = NULL; | ||
| 530 | static char *opt_embed = NULL; | ||
| 531 | static char *opt_class = NULL; | 528 | static char *opt_class = NULL; |
| 532 | static char *opt_font = NULL; | 529 | static char *opt_embed = NULL; |
| 533 | static char *opt_line = NULL; | 530 | static char *opt_font = NULL; |
| 534 | static int oldbutton = 3; /* button event on startup: 3 = release */ | 531 | static char *opt_io = NULL; |
| 532 | static char *opt_line = NULL; | ||
| 533 | static char *opt_name = NULL; | ||
| 534 | static char *opt_title = NULL; | ||
| 535 | static int oldbutton = 3; /* button event on startup: 3 = release */ | ||
| 535 | 536 | ||
| 536 | static char *usedfont = NULL; | 537 | static char *usedfont = NULL; |
| 537 | static double usedfontsize = 0; | 538 | static double usedfontsize = 0; |
| @@ -3240,7 +3241,8 @@ xclear(int x1, int y1, int x2, int y2) | |||
| 3240 | void | 3241 | void |
| 3241 | xhints(void) | 3242 | xhints(void) |
| 3242 | { | 3243 | { |
| 3243 | XClassHint class = {termname, opt_class ? opt_class : termname}; | 3244 | XClassHint class = {opt_name ? opt_name : termname, |
| 3245 | opt_class ? opt_class : termname}; | ||
| 3244 | XWMHints wm = {.flags = InputHint, .input = 1}; | 3246 | XWMHints wm = {.flags = InputHint, .input = 1}; |
| 3245 | XSizeHints *sizeh = NULL; | 3247 | XSizeHints *sizeh = NULL; |
| 3246 | 3248 | ||
| @@ -4332,13 +4334,12 @@ run(void) | |||
| 4332 | void | 4334 | void |
| 4333 | usage(void) | 4335 | usage(void) |
| 4334 | { | 4336 | { |
| 4335 | die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]" | 4337 | die("usage: %s " |
| 4336 | " [-o file] [-T title]\n" | 4338 | "[-aiv] [-c class] [-f font] [-g geometry] [-n name] [-o file]\n " |
| 4337 | " [-t title] [-w windowid] [[-e] command [args ...]]\n" | 4339 | " [-T title] [-t title] [-w windowid] [[-e] command [args ...]\n " |
| 4338 | " %s [-aiv] [-c class] [-f font] [-g geometry]" | 4340 | " %s [-aiv] [-c class] [-f font] [-g geometry] [-n name] [-o file]\n " |
| 4339 | " [-o file] [-T title]\n" | 4341 | " [-o file] [-T title] [-t title] [-w windowid] -l line" |
| 4340 | " [-t title] [-w windowid] -l line [stty_args ...]\n", | 4342 | " [stty_args ...]\n", argv0, argv0); |
| 4341 | argv0, argv0); | ||
| 4342 | } | 4343 | } |
| 4343 | 4344 | ||
| 4344 | void | 4345 | void |
| @@ -4383,6 +4384,9 @@ main(int argc, char *argv[]) | |||
| 4383 | case 'l': | 4384 | case 'l': |
| 4384 | opt_line = EARGF(usage()); | 4385 | opt_line = EARGF(usage()); |
| 4385 | break; | 4386 | break; |
| 4387 | case 'n': | ||
| 4388 | opt_name = EARGF(usage()); | ||
| 4389 | break; | ||
| 4386 | case 't': | 4390 | case 't': |
| 4387 | case 'T': | 4391 | case 'T': |
| 4388 | opt_title = EARGF(usage()); | 4392 | opt_title = EARGF(usage()); |
