diff options
author | Quentin Rameau <quinq@fifth.space> | 2016-01-29 22:03:01 +0100 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2016-01-30 09:45:23 +0100 |
commit | 0cd5117a2cfc4134712de748ec416be0655838b2 (patch) | |
tree | 40f130bd62141fe15efd65992422ea84750b39ac /st.c | |
parent | bd5fdbe64c8abfb624ad59939ed9b221c8b04eef (diff) | |
download | st-0cd5117a2cfc4134712de748ec416be0655838b2.tar.gz st-0cd5117a2cfc4134712de748ec416be0655838b2.zip |
Add -n option for setting WM_CLASS instance name
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 34 |
1 files changed, 19 insertions, 15 deletions
@@ -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()); |