Hi list, fueled by the recent bunch of patches to st, I gave it a try. One thing that was missing (for me) was being able to set the class of the st window. I use that for matching terminals running different apps to different tags so I can have an ssh session running irssi at the 'chat' tag or running mutt at the 'mail' tag.
Note that this is my first try with hg (I'm more used to git) so please forgive me if my patch is somehow mangled or malformed :) -- $l="\n";$p=q-sub r{rand}sub c{((shift)**2+(shift)**2)<1}while( $i++<=$s){$t++if c r,r}die("Gregor Best, 0xDB9F9A7C, ".($t/$s* 4).$l)-;$s+=ord$$|$_ for split //,$p;srand($s|$$);eval$p;die$@
# HG changeset patch # User Gregor Best <g...@ring0.de> # Date 1290106513 -3600 # Node ID 75a453a5590c9fe376d88c9a48019e04bcb603fc # Parent 757a309bdbbb8afff5b851b4367c6744d48b8791 Add -c option to set st's class diff -r 757a309bdbbb -r 75a453a5590c st.c --- a/st.c Thu Nov 18 01:00:04 2010 +0100 +++ b/st.c Thu Nov 18 19:55:13 2010 +0100 @@ -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 @@ -246,6 +246,7 @@ static Selection sel; static char *opt_cmd = NULL; static char *opt_title = NULL; +static char *opt_class = NULL; /* UTF-8 decode */ static int @@ -1447,7 +1448,7 @@ 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, @@ -1839,6 +1840,9 @@ for(i = 1; i < argc; i++) { switch(argv[i][0] != '-' || argv[i][2] ? -1 : argv[i][1]) { + case 'c': + if(++i < argc) opt_class = argv[i]; + break; case 't': if(++i < argc) opt_title = argv[i]; break;
pgp5mJCpLzr90.pgp
Description: PGP signature