commit 33165e7b9a47d37780626c4873d5dcb74cde1283
parent 90a033cf5a49bbef434decde949aa6a7674a7d93
Author: Benjamin Chausse <benjamin@chausse.xyz>
Date:   Sun, 29 Nov 2020 22:01:25 -0500

Now the edits are live...

Diffstat:
Mconfig.def.h | 66++++++++++++++++++++++++++++++++++++++++--------------------------
Mdwm.c | 15++++++++++-----
2 files changed, 50 insertions(+), 31 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -2,7 +2,7 @@ /* appearance */ static const unsigned int borderpx = 0; /* border pixel of windows */ -static const unsigned int gappx = 8; /* gap pixel between windows */ +static const unsigned int gappx = 3; /* gap pixel between windows */ static const unsigned int snap = 15; /* snap pixel */ static const int swallowfloating = 1; /* 1 means swallow floating windows by default */ static const int showbar = 1; /* 0 means no bar */ @@ -10,18 +10,30 @@ static const int topbar = 1; /* 0 means bottom bar */ static const int user_bh = 28; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ static const char *fonts[] = { "monospace:size=12" }; static const char dmenufont[] = "monospace:size=12"; -static const char col_gray1[] = "#222d32"; -static const char col_gray2[] = "#343e42"; -static const char col_white[] = "#f2f1f0"; -static const char col_gray4[] = "#aaccbb"; -static const char col_cyan[] = "#42717b"; +static const char col_norm_fg[] = "#9B9257"; +static const char col_norm_bg[] = "#111A1F"; +static const char col_norm_border[] = "#111A1F"; +static const char col_sel_fg[] = "#111A1F"; +static const char col_sel_bg[] = "#716045"; +static const char col_sel_border[] = "#1A282F"; + +/* static const char col_gray1[] = "#222d32"; */ +/* static const char col_gray2[] = "#343e42"; */ +/* static const char col_white[] = "#f2f1f0"; */ +/* static const char col_gray4[] = "#aaccbb"; */ +/* static const char col_cyan[] = "#42717b"; */ static const unsigned int baralpha = 0xd0; static const unsigned int borderalpha = OPAQUE; static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_white, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, + /* fg bg border */ + [SchemeNorm] = { col_norm_fg, col_norm_bg, col_norm_border }, + [SchemeSel] = { col_sel_fg, col_sel_bg, col_sel_border }, }; +/* static const char *colors[][3] = { */ +/* /1* fg bg border *1/ */ +/* [SchemeNorm] = { col_white, col_gray1, col_gray2 }, */ +/* [SchemeSel] = { col_gray4, col_cyan, col_cyan }, */ +/* }; */ static const unsigned int alphas[][3] = { /* fg bg border */ [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, @@ -37,19 +49,21 @@ static const Rule rules[] = { * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask iscentered isfloating isterminal noswallow monitor */ - { "Gimp", NULL, NULL, 0, 0, 1, 0, 0, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, 0, 0, 0, -1 }, - { NULL, NULL, "Picture-in-Picture",1, 0, 0, 0, 0, -1 }, - { "St", NULL, NULL, 0, 0, 0, 1, 0, -1 }, - { "dropdown",NULL, NULL, 0, 1, 1, 0, 0, -1 }, - { "youtube", NULL, NULL, 0, 1, 1, 1, 0, -1 }, - { NULL, NULL, "Event Tester", 0, 0, 1, 0, 1, -1 }, /* xev */ - { "R_x11", NULL, NULL, 0, 0, 1, 0, 1, -1 }, /* R popup */ - { "Matplotlib",NULL, NULL, 0, 1, 1, 0, 1, -1 }, /* Python popups */ - { "Dropbox-cli",NULL, NULL, 0, 0, 1, 0, 1, -1 }, - { NULL, NULL, "Kite", 0, 0, 0, 0, 1, -1 }, - { "Arandr", NULL, NULL, 0, 1, 1, 0, 0, -1 }, + /* class instance title tags mask iscentered isfloating isterminal noswallow monitor canfocus */ + { "Gimp", NULL, NULL, 0, 0, 1, 0, 0, -1, 1 }, + { "Firefox", NULL, NULL, 1 << 8, 0, 0, 0, 0, -1, 1 }, + { NULL, NULL, "Picture-in-Picture",1, 0, 0, 0, 0, -1, 1 }, + { "St", NULL, NULL, 0, 0, 0, 1, 0, -1, 1 }, + { "dropdown",NULL, NULL, 0, 1, 1, 0, 0, -1, 1 }, + { "youtube", NULL, NULL, 0, 1, 1, 1, 0, -1, 1 }, + { NULL, NULL, "Event Tester", 0, 0, 1, 0, 1, -1, 1 }, /* xev */ + { "R_x11", NULL, NULL, 0, 0, 1, 0, 1, -1, 0 }, /* R popup */ + { "Matplotlib",NULL, NULL, 0, 1, 1, 0, 1, -1, 0 }, /* Python popups */ + { NULL,NULL,"Subplot Configuration Tool",0, 1, 1, 0, 1, -1, 0 }, /* Python popups */ + + { "Dropbox-cli",NULL, NULL, 0, 0, 1, 0, 1, -1, 1 }, + { NULL, NULL, "Kite", 0, 0, 0, 0, 1, -1, 1 }, + { "Arandr", NULL, NULL, 0, 1, 1, 0, 0, -1, 1 }, }; /* include functions */ @@ -63,9 +77,9 @@ static const int resizehints = 0; /* 1 means respect size hints in tiled resi static const Layout layouts[] = { /* symbol arrange function */ - { "  ", tile }, /* first entry is default */ - { "  ", NULL }, /* no layout function means floating behavior */ - { "  ", monocle }, + { "  ", tile }, /* first entry is default */ + { "  ", NULL }, /* no layout function means floating behavior */ + { "  ", monocle }, { "  ", centeredmaster }, { "  ", centeredfloatingmaster }, { "  ", gaplessgrid }, @@ -88,7 +102,7 @@ static const Layout layouts[] = { /* commands */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_white, "-sb", col_cyan, "-sf", col_gray4, NULL }; +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_norm_bg, "-nf", col_norm_fg, "-sb", col_sel_fg, "-sf", col_sel_bg, NULL }; /* static const char *termcmd[] = { "st", NULL }; */ #include "movestack.c" diff --git a/dwm.c b/dwm.c @@ -96,7 +96,7 @@ struct Client { int basew, baseh, incw, inch, maxw, maxh, minw, minh; int bw, oldbw; unsigned int tags; - int isfixed, iscentered, isurgent, neverfocus, oldstate, isfullscreen, isfloating, isterminal, noswallow; + int isfixed, iscentered, isurgent, neverfocus, oldstate, isfullscreen, isfloating, isterminal, noswallow, canfocus; pid_t pid; Client *next; Client *snext; @@ -153,6 +153,7 @@ typedef struct { int isterminal; int noswallow; int monitor; + int canfocus; } Rule; /* function declarations */ @@ -338,6 +339,7 @@ applyrules(Client *c) /* rule matching */ c->noswallow = -1; c->isfloating = 0; + c->canfocus = 1; c->tags = 0; XGetClassHint(dpy, c->win, &ch); class = ch.res_class ? ch.res_class : broken; @@ -353,6 +355,7 @@ applyrules(Client *c) c->noswallow = r->noswallow; c->iscentered = r->iscentered; c->isfloating = r->isfloating; + c->canfocus = r->canfocus; c->tags |= r->tags; for (m = mons; m && m->num != r->monitor; m = m->next); if (m) @@ -1000,6 +1003,8 @@ focus(Client *c) if (selmon->sel && selmon->sel != c) unfocus(selmon->sel, 0); if (c) { + if (!c->canfocus) + return; if (c->mon != selmon) selmon = c->mon; if (c->isurgent) @@ -1059,16 +1064,16 @@ focusstack(const Arg *arg) if (!selmon->sel) return; if (arg->i > 0) { - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); + for (c = selmon->sel->next; c && (!ISVISIBLE(c) || !c->canfocus); c = c->next); if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); + for (c = selmon->clients; c && (!ISVISIBLE(c) || !c->canfocus); c = c->next); } else { for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i)) + if (ISVISIBLE(i) && i->canfocus) c = i; if (!c) for (; i; i = i->next) - if (ISVISIBLE(i)) + if (ISVISIBLE(i) && i->canfocus) c = i; } if (c) {