diff options
author | Christoph Lohmann <20h@r-36.net> | 2013-06-06 19:09:18 +0200 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2013-06-06 19:09:18 +0200 |
commit | 369734c80c6e5049d704a00f436c59ecf4dafae8 (patch) | |
tree | fb6472eb9c48a6048486049561386100ee135b4f | |
parent | 2cf4f366d615a4e5ed199f90e6cdb7741606a38e (diff) | |
download | st-patched-369734c80c6e5049d704a00f436c59ecf4dafae8.tar.bz2 st-patched-369734c80c6e5049d704a00f436c59ecf4dafae8.tar.xz st-patched-369734c80c6e5049d704a00f436c59ecf4dafae8.zip |
Adding xterm behaviour to setting the title.
Thanks Airwave!
-rw-r--r-- | st.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -19,6 +19,7 @@ | |||
19 | #include <sys/wait.h> | 19 | #include <sys/wait.h> |
20 | #include <time.h> | 20 | #include <time.h> |
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <libgen.h> | ||
22 | #include <X11/Xatom.h> | 23 | #include <X11/Xatom.h> |
23 | #include <X11/Xlib.h> | 24 | #include <X11/Xlib.h> |
24 | #include <X11/Xutil.h> | 25 | #include <X11/Xutil.h> |
@@ -3622,6 +3623,7 @@ int | |||
3622 | main(int argc, char *argv[]) { | 3623 | main(int argc, char *argv[]) { |
3623 | int bitm, xr, yr; | 3624 | int bitm, xr, yr; |
3624 | uint wr, hr; | 3625 | uint wr, hr; |
3626 | char *titles; | ||
3625 | 3627 | ||
3626 | xw.fw = xw.fh = xw.fx = xw.fy = 0; | 3628 | xw.fw = xw.fh = xw.fx = xw.fy = 0; |
3627 | xw.isfixed = False; | 3629 | xw.isfixed = False; |
@@ -3635,8 +3637,13 @@ main(int argc, char *argv[]) { | |||
3635 | break; | 3637 | break; |
3636 | case 'e': | 3638 | case 'e': |
3637 | /* eat all remaining arguments */ | 3639 | /* eat all remaining arguments */ |
3638 | if(argc > 1) | 3640 | if(argc > 1) { |
3639 | opt_cmd = &argv[1]; | 3641 | opt_cmd = &argv[1]; |
3642 | if(argv[1] != NULL) { | ||
3643 | titles = strdup(argv[1]); | ||
3644 | opt_title = basename(titles); | ||
3645 | } | ||
3646 | } | ||
3640 | goto run; | 3647 | goto run; |
3641 | case 'f': | 3648 | case 'f': |
3642 | opt_font = EARGF(usage()); | 3649 | opt_font = EARGF(usage()); |