aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorGregor Best <gbe@ring0.de>2010-11-19 17:13:13 +0100
committerGregor Best <gbe@ring0.de>2010-11-19 17:13:13 +0100
commite417230f3818c84306ee7bd29772d857f76701d4 (patch)
tree62cc9e6dc70d60111a325c944022747ee1dbf170 /st.c
parent0735e8e760fe8b639dbe4d932d8e79c8f1969f33 (diff)
downloadst-e417230f3818c84306ee7bd29772d857f76701d4.tar.gz
st-e417230f3818c84306ee7bd29772d857f76701d4.tar.bz2
Add -c option to override the default window class
Diffstat (limited to 'st.c')
-rw-r--r--st.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/st.c b/st.c
index b25fe89..bed7e8d 100644
--- a/st.c
+++ b/st.c
@@ -31,7 +31,7 @@
#define USAGE \
"st-" VERSION ", (c) 2010 st engineers\n" \
- "usage: st [-t title] [-e cmd] [-v]\n"
+ "usage: st [-t title] [-c class] [-e cmd] [-v]\n"
/* Arbitrary sizes */
#define ESC_TITLE_SIZ 256
@@ -252,6 +252,7 @@ static pid_t pid;
static Selection sel;
static char *opt_cmd = NULL;
static char *opt_title = NULL;
+static char *opt_class = NULL;
/* UTF-8 decode */
static int stou(char *s, long *u) {
@@ -1443,7 +1444,7 @@ xclear(int x1, int y1, int x2, int y2) {
void
xhints(void)
{
- XClassHint class = {TNAME, TNAME};
+ XClassHint class = {opt_class ? opt_class : TNAME, TNAME};
XWMHints wm = {.flags = InputHint, .input = 1};
XSizeHints size = {
.flags = PSize | PResizeInc | PBaseSize,
@@ -1838,6 +1839,9 @@ main(int argc, char *argv[]) {
case 't':
if(++i < argc) opt_title = argv[i];
break;
+ case 'c':
+ if(++i < argc) opt_class = argv[i];
+ break;
case 'e':
if(++i < argc) opt_cmd = argv[i];
break;