diff --git a/.config/suckless/dwm/config.h b/.config/suckless/dwm/config.h index 337720b..1252f92 100644 --- a/.config/suckless/dwm/config.h +++ b/.config/suckless/dwm/config.h @@ -4,6 +4,10 @@ static const int showbar = 0; static const int topbar = 0; static const char *fonts[] = { "Cascadia Mono:style=Bold:size=10:antialias=true:autohint=true" }; +static const char *colors[][3] = { + [SchemeNorm] = { "#D3C6AA", "#272E33", "#83C092" }, + [SchemeSel] = { "#374145", "#DBBC7F", "#A7C080" }, +}; static const char *tags[] = { "1", "2", "3" }; static const Rule rules[] = { diff --git a/.config/suckless/dwm/dwm.c b/.config/suckless/dwm/dwm.c index 398506d..d88596f 100644 --- a/.config/suckless/dwm/dwm.c +++ b/.config/suckless/dwm/dwm.c @@ -160,6 +160,7 @@ static int sendevent(Client *c, Atom proto); static void setclientstate(Client *c, long state); static void setfocus(Client *c); static void setfullscreen(Client *c, int fullscreen); +static void setmfact(const Arg *arg); static void setup(void); static void seturgent(Client *c, int urg); static void showhide(Client *c); @@ -383,8 +384,8 @@ cleanup(void) cleanupmon(mons); for (i = 0; i < CurLast; i++) drw_cur_free(drw, cursor[i]); - // for (i = 0; i < LENGTH(colors); i++) - // free(scheme[i]); + for (i = 0; i < LENGTH(colors); i++) + free(scheme[i]); free(scheme); XDestroyWindow(dpy, wmcheckwin); drw_free(drw); @@ -1173,10 +1174,25 @@ setfullscreen(Client *c, int fullscreen) } } +/* arg > 1.0 will set mfact absolutely */ +void +setmfact(const Arg *arg) +{ + float f; + + if (!arg || !selmon->lt[selmon->sellt]->arrange) + return; + f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; + if (f < 0.05 || f > 0.95) + return; + selmon->mfact = f; + arrange(selmon); +} + void setup(void) { - // int i; + int i; XSetWindowAttributes wa; Atom utf8string; struct sigaction sa; @@ -1221,9 +1237,9 @@ setup(void) cursor[CurResize] = drw_cur_create(drw, XC_sizing); cursor[CurMove] = drw_cur_create(drw, XC_fleur); /* init appearance */ - // scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - // for (i = 0; i < LENGTH(colors); i++) - // scheme[i] = drw_scm_create(drw, colors[i], 3); + scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); + for (i = 0; i < LENGTH(colors); i++) + scheme[i] = drw_scm_create(drw, colors[i], 3); /* init bars */ updatebars(); updatestatus();