Adding xterm behaviour to setting the title.

Thanks Airwave!
dev
Christoph Lohmann 2013-06-06 19:09:18 +02:00
parent 2cf4f366d6
commit 369734c80c
1 changed files with 8 additions and 1 deletions

9
st.c
View File

@ -19,6 +19,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include <libgen.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
@ -3622,6 +3623,7 @@ int
main(int argc, char *argv[]) { main(int argc, char *argv[]) {
int bitm, xr, yr; int bitm, xr, yr;
uint wr, hr; uint wr, hr;
char *titles;
xw.fw = xw.fh = xw.fx = xw.fy = 0; xw.fw = xw.fh = xw.fx = xw.fy = 0;
xw.isfixed = False; xw.isfixed = False;
@ -3635,8 +3637,13 @@ main(int argc, char *argv[]) {
break; break;
case 'e': case 'e':
/* eat all remaining arguments */ /* eat all remaining arguments */
if(argc > 1) if(argc > 1) {
opt_cmd = &argv[1]; opt_cmd = &argv[1];
if(argv[1] != NULL) {
titles = strdup(argv[1]);
opt_title = basename(titles);
}
}
goto run; goto run;
case 'f': case 'f':
opt_font = EARGF(usage()); opt_font = EARGF(usage());