diff --git a/config.def.h b/config.def.h index cae2009..5fa686b 100644 --- a/config.def.h +++ b/config.def.h @@ -3,6 +3,12 @@ #define MOD Mod4Mask +//bar stuff: +/* +#define GAP_SIZE bar_height +const char* barname = "bar" // for lemonbar +*/ + const char* menu[] = {"dmenu_run", 0}; const char* term[] = {"st", 0}; const char* scrot[] = {"scr", 0}; diff --git a/sowm.c b/sowm.c index 96f8340..d074c10 100644 --- a/sowm.c +++ b/sowm.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "sowm.h" @@ -138,8 +139,7 @@ void win_fs(const Arg arg) { if ((cur->f = cur->f ? 0 : 1)) { win_size(cur->w, &cur->wx, &cur->wy, &cur->ww, &cur->wh); - XMoveResizeWindow(d, cur->w, 0, 0, sw, sh); - + XMoveResizeWindow(d, cur->w, 0, GAP_SIZE, sw, sh - GAP_SIZE); } else { XMoveResizeWindow(d, cur->w, cur->wx, cur->wy, cur->ww, cur->wh); } @@ -188,7 +188,17 @@ void ws_go(const Arg arg) { ws_sel(tmp); - for win XUnmapWindow(d, c->w); + for win { + char* winame = NULL; + if (!XFetchName(d, c->w, &winame) || winame == NULL) { + XUnmapWindow(d, c->w); + } else { + if (strncmp(winame, barname, strlen(barname))) { + XUnmapWindow(d, c->w); + } + XFree(winame); + } + } ws_sel(arg.i); @@ -279,7 +289,7 @@ int main(void) { root = RootWindow(d, s); sw = XDisplayWidth(d, s); sh = XDisplayHeight(d, s); - + XSelectInput(d, root, SubstructureRedirectMask); XDefineCursor(d, root, XCreateFontCursor(d, 68)); input_grab(root);