diff --git a/awesome.c b/awesome.c index 5a1b0bad..cd996037 100644 --- a/awesome.c +++ b/awesome.c @@ -207,6 +207,7 @@ main(int argc, char *argv[]) Display * dpy; int shape_event, randr_event_base; int screen, screen_count; + int i, cmdlen; event_handler **handler; struct sockaddr_un *addr; @@ -235,6 +236,16 @@ main(int argc, char *argv[]) if(!(dpy = XOpenDisplay(NULL))) eprint("cannot open display\n"); + for(cmdlen = 0, i = 0; i < argc; i++) + cmdlen += a_strlen(argv[i] + 1); + globalconf.argv = p_new(char, cmdlen); + a_strcpy(globalconf.argv, cmdlen, argv[0]); + for(i = 1; i < argc; i++) + { + a_strcat(globalconf.argv, cmdlen, " "); + a_strcat(globalconf.argv, cmdlen, argv[i]); + } + xfd = ConnectionNumber(dpy); XSetErrorHandler(xerrorstart); diff --git a/config.h b/config.h index 4a90f3ef..5cb5b4ab 100644 --- a/config.h +++ b/config.h @@ -313,6 +313,8 @@ struct AwesomeConf FocusList *focus; /** Link between tags and clients */ TagClientLink *tclink; + /** Command line passed to awesome */ + char *argv; }; void config_parse(const char *); diff --git a/event.c b/event.c index 526bb985..9d128847 100644 --- a/event.c +++ b/event.c @@ -37,7 +37,7 @@ #include "widget.h" #include "layouts/tile.h" #include "layouts/floating.h" - +#include "xutil.h" extern AwesomeConf globalconf; @@ -410,6 +410,7 @@ void handle_event_randr_screen_change_notify(XEvent *e) { XRRUpdateConfiguration(e); + uicb_exec(0, globalconf.argv); } void