diff --git a/config.h b/config.h index 5835eb3..97a89e5 100644 --- a/config.h +++ b/config.h @@ -122,3 +122,8 @@ Button buttons[] = { { BUTTON1_TRIPLE_CLICKED, { mouse_zoom, { NULL } } }, { BUTTON2_CLICKED, { mouse_minimize, { NULL } } }, }; + +/* gets executed when dvtm is started */ +Action actions[] = { + { create, { SHELL } }, +}; diff --git a/dvtm.c b/dvtm.c index 9cc4630..fc6c857 100644 --- a/dvtm.c +++ b/dvtm.c @@ -97,6 +97,7 @@ enum { BarTop, BarBot, BarOff }; /* commands for use by keybindings */ void quit(const char *args[]); void create(const char *args[]); +void startup(const char *args[]); void escapekey(const char *args[]); void killclient(const char *args[]); void focusn(const char *args[]); @@ -135,7 +136,7 @@ int statusfd = -1; char stext[512]; int barpos = BARPOS; unsigned int ltidx = 0; -bool need_screen_resize = false; +bool need_screen_resize = true; int width, height; bool running = true; @@ -720,8 +721,9 @@ sigterm_handler(int sig){ void resize_screen(){ - debug("resize_screen(), w: %d h: %d\n", width, height); + debug("resize_screen()\n"); if(need_screen_resize){ + debug("resize_screen(), w: %d h: %d\n", width, height); #if defined(__OpenBSD__) || defined(__NetBSD__) resizeterm(height, width); #else @@ -738,6 +740,13 @@ resize_screen(){ } void +startup(const char *args[]){ + int i; + for(i = 0; i < countof(actions); i++) + actions[i].cmd(actions[i].args); +} + +void setup(){ int i; mmask_t mask; @@ -824,6 +833,7 @@ int main(int argc, char *argv[]) { parse_args(argc, argv); setup(); + startup(NULL); while(running){ Client *c; int r, nfds = 0;