aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2016-01-29 22:03:01 +0100
committerChristoph Lohmann <20h@r-36.net>2016-01-30 09:45:23 +0100
commit0cd5117a2cfc4134712de748ec416be0655838b2 (patch)
tree40f130bd62141fe15efd65992422ea84750b39ac /st.c
parentbd5fdbe64c8abfb624ad59939ed9b221c8b04eef (diff)
downloadst-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.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/st.c b/st.c
index 2bbf484..38abffb 100644
--- a/st.c
+++ b/st.c
@@ -524,14 +524,15 @@ static int cmdfd;
524static pid_t pid; 524static pid_t pid;
525static Selection sel; 525static Selection sel;
526static int iofd = 1; 526static int iofd = 1;
527static char **opt_cmd = NULL; 527static char **opt_cmd = NULL;
528static char *opt_io = NULL;
529static char *opt_title = NULL;
530static char *opt_embed = NULL;
531static char *opt_class = NULL; 528static char *opt_class = NULL;
532static char *opt_font = NULL; 529static char *opt_embed = NULL;
533static char *opt_line = NULL; 530static char *opt_font = NULL;
534static int oldbutton = 3; /* button event on startup: 3 = release */ 531static char *opt_io = NULL;
532static char *opt_line = NULL;
533static char *opt_name = NULL;
534static char *opt_title = NULL;
535static int oldbutton = 3; /* button event on startup: 3 = release */
535 536
536static char *usedfont = NULL; 537static char *usedfont = NULL;
537static double usedfontsize = 0; 538static double usedfontsize = 0;
@@ -3240,7 +3241,8 @@ xclear(int x1, int y1, int x2, int y2)
3240void 3241void
3241xhints(void) 3242xhints(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)
4332void 4334void
4333usage(void) 4335usage(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
4344void 4345void
@@ -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());