summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dwm/config.def.h64
-rw-r--r--dwm/dwm.c10
-rw-r--r--dwm/unpatched/dwm-floatrules-20210801-138b405.diff71
3 files changed, 110 insertions, 35 deletions
diff --git a/dwm/config.def.h b/dwm/config.def.h
index 45126bb..1331203 100644
--- a/dwm/config.def.h
+++ b/dwm/config.def.h
@@ -106,13 +106,13 @@ typedef struct {
const char *spcmd1[] = { TERMINAL, "-n", "spterm", "-g", "120x34", NULL };
const char *spcmd2[] = { TERMINAL, "-n", "splf", "-g", "144x41", "-e", "lf", NULL };
const char *spcmd3[] = { TERMINAL, "-n", "spcalc", "-f", "monospace:size=16", "-g", "50x20", "-e", "bc", "-lq", NULL };
-const char *spcmd4[] = { "keepassxc", NULL };
+const char *spcmd4[] = { TERMINAL, "-n", "vimwikitodo", "-f", "monospace:size=12", "-g", "35x15", "-e", "vimwikitodo", NULL };
static Sp scratchpads[] = {
/* name cmd */
{"spterm", spcmd1},
{"splf", spcmd2},
{"spcalc", spcmd3},
- {"keepassxc", spcmd4},
+ {"vimwikitodo", spcmd4},
};
/* tagging */
@@ -144,24 +144,24 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
- /* class instance title tags mask allowkill focusopacity unfocusopacity isfloating isterminal noswallow monitor resizehints border width */
- { BROWSER, "Navigator", NULL, 1 << 1, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 1, -1 },
- { "libreoffice", "libreoffice", NULL, 1 << 2, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 1, -1 },
- { "mpv", "mpvk", NULL, 1 << 3, 1, activeopacity, inactiveopacity, 0, 1, -1, -1, 0, 0 },
- { TERMCLASS, "ncmpcpp", NULL, 1 << 4, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 1, -1 },
- { "Virt-manager", "virt-manager", NULL, 1 << 5, 1, activeopacity, inactiveopacity, 0, 0, 0, -1, 1, -1 },
- { "Gimp", NULL, NULL, 1 << 6, 1, activeopacity, inactiveopacity, 1, 0, 0, -1, 1, -1 },
- { TERMCLASS, "bg", NULL, 1 << 6, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 1, -1 },
- { "obs", "obs", NULL, 1 << 7, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 0, 0 },
- { "discord", "discord", NULL, 1 << 8, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 0, 0 },
- { "kakaotalk", NULL, NULL, 1 << 8, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 0, 0 },
- { NULL, "spterm", NULL, SPTAG(0), 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 1, -1 },
- { NULL, "splf", NULL, SPTAG(1), 1, activeopacity, inactiveopacity, 1, 0, 0, -1, 1, -1 },
- { NULL, "spcal", NULL, SPTAG(2), 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 1, -1 },
- { NULL, "keepassxc", NULL, SPTAG(3), 1, activeopacity, inactiveopacity, 0, 0, 0, -1, 1, -1 },
- { TERMCLASS, NULL, NULL, 0, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 0, -1 },
- { TERMCLASS, "floatterm", NULL, 0, 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 0, 0 },
- { NULL, NULL, "Event Tester", 0, 1, activeopacity, inactiveopacity, 0, 0, 1, -1, 1, -1 }, /* xev */
+ /* class instance title tags mask allowkill focusopacity unfocusopacity isfloating isterminal noswallow monitor resizehints border width */
+ { BROWSER, "Navigator", NULL, 1 << 1, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 1, -1 },
+ { "libreoffice", "libreoffice", NULL, 1 << 2, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 1, -1 },
+ { "mpv", "mpvk", NULL, 1 << 3, 1, activeopacity, inactiveopacity, 0, 1, -1, -1, 1, 0 },
+ { TERMCLASS, "ncmpcpp", NULL, 1 << 4, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 1, -1 },
+ { "Virt-manager", "virt-manager", NULL, 1 << 5, 1, activeopacity, inactiveopacity, 0, 0, 0, -1, 1, -1 },
+ { "Gimp", NULL, NULL, 1 << 6, 1, activeopacity, inactiveopacity, 1, 0, 0, -1, 1, -1 },
+ { TERMCLASS, "bg", NULL, 1 << 6, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 1, -1 },
+ { "obs", "obs", NULL, 1 << 7, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 1, 0 },
+ { "discord", "discord", NULL, 1 << 8, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 1, 0 },
+ { "kakaotalk", NULL, NULL, 1 << 8, 1, activeopacity, inactiveopacity, 0, 0, -1, -1, 1, 0 },
+ { TERMCLASS, "spterm", NULL, SPTAG(0), 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 1, -1 },
+ { TERMCLASS, "splf", NULL, SPTAG(1), 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 1, -1 },
+ { TERMCLASS, "spcalc", NULL, SPTAG(2), 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 1, -1 },
+ { TERMCLASS, "vimwikitodo", NULL, SPTAG(3), 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 1, -1 },
+ { TERMCLASS, TERMINAL, NULL, 0, 1, activeopacity, inactiveopacity, 0, 1, 0, -1, 1, -1 },
+ { TERMCLASS, "floatterm", NULL, 0, 1, activeopacity, inactiveopacity, 1, 1, 0, -1, 1, 0 },
+ { NULL, NULL, "Event Tester", 0, 1, activeopacity, inactiveopacity, 0, 0, 1, -1, 1, -1 }, /* xev */
};
/* layout(s) */
@@ -600,27 +600,27 @@ static Keychord *keychords[] = {
// TOGGLES
&((Keychord){1, {{WINMOD2, XK_f}}, togglefullscr, {0} }),
- &((Keychord){2, {{WINKEY, XK_s},{0, XK_m}}, scratchpad_show, {.i = 1} }),
- &((Keychord){2, {{WINKEY, XK_s},{0, XK_comma}}, scratchpad_show, {.i = 2} }),
- &((Keychord){2, {{WINKEY, XK_s},{0, XK_period}}, scratchpad_show, {.i = 3} }),
- &((Keychord){2, {{WINKEY, XK_s},{ShiftMask, XK_m}}, scratchpad_hide, {.i = 1} }),
- &((Keychord){2, {{WINKEY, XK_s},{ShiftMask, XK_comma}}, scratchpad_hide, {.i = 2} }),
- &((Keychord){2, {{WINKEY, XK_s},{ShiftMask, XK_period}}, scratchpad_hide, {.i = 3} }),
- &((Keychord){2, {{WINKEY, XK_s},{0, XK_x}}, scratchpad_remove, {0} }),
+ &((Keychord){2, {{WINMOD2, XK_s},{0, XK_x}}, scratchpad_remove, {0} }),
+ &((Keychord){2, {{WINMOD2, XK_s},{0, XK_1}}, scratchpad_show, {.i = 1} }),
+ &((Keychord){2, {{WINMOD2, XK_s},{0, XK_2}}, scratchpad_show, {.i = 2} }),
+ &((Keychord){2, {{WINMOD2, XK_s},{0, XK_3}}, scratchpad_show, {.i = 3} }),
+ &((Keychord){2, {{WINMOD2, XK_s},{ShiftMask, XK_1}}, scratchpad_hide, {.i = 1} }),
+ &((Keychord){2, {{WINMOD2, XK_s},{ShiftMask, XK_2}}, scratchpad_hide, {.i = 2} }),
+ &((Keychord){2, {{WINMOD2, XK_s},{ShiftMask, XK_3}}, scratchpad_hide, {.i = 3} }),
&((Keychord){2, {{WINKEY, XK_t},{0, XK_f}}, togglefloating, {0} }),
&((Keychord){2, {{WINKEY, XK_t},{ControlMask, XK_f}}, togglecanfocusfloating, {0} }),
&((Keychord){2, {{WINKEY, XK_t},{0, XK_m}}, spawn, SHCMD("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle; kill -40 $(pidof dwmblocks)") }),
- &((Keychord){2, {{WINKEY, XK_t},{0, XK_p}}, togglescratch, {.ui = 1 } }), // calculator //
&((Keychord){2, {{WINKEY, XK_t},{0, XK_q}}, toggleallowkill, {0} }),
&((Keychord){2, {{WINKEY, XK_t},{0, XK_s}}, togglesticky, {0} }),
&((Keychord){2, {{WINKEY, XK_t},{0, XK_t}}, togglealttag, {0} }),
&((Keychord){2, {{WINKEY, XK_t},{0, XK_apostrophe}}, togglemark, {0} }),
&((Keychord){2, {{WINKEY, XK_t},{0, XK_space}}, togglealwaysontop, {0} }),
&((Keychord){2, {{WINKEY, XK_t},{0, XK_Tab}}, toggleall, {0} }),
- &((Keychord){1, {{WINMOD2, XK_Return}}, togglescratch, {.ui = 0 } }), // terminal //
- &((Keychord){2, {{WINKEY, XK_t},{0, XK_1}}, togglescratch, {.ui = 0 } }),
- &((Keychord){2, {{WINKEY, XK_t},{0, XK_2}}, togglescratch, {.ui = 1 } }),
- &((Keychord){2, {{WINKEY, XK_t},{0, XK_3}}, togglescratch, {.ui = 2 } }),
+ &((Keychord){2, {{WINKEY, XK_t},{0, XK_1}}, togglescratch, {.ui = 0 } }), // terminal //
+ &((Keychord){2, {{WINKEY, XK_t},{0, XK_2}}, togglescratch, {.ui = 1 } }), // lf //
+ &((Keychord){2, {{WINKEY, XK_t},{0, XK_3}}, togglescratch, {.ui = 2 } }), // calculator //
+ &((Keychord){2, {{WINKEY, XK_t},{0, XK_4}}, togglescratch, {.ui = 3 } }), // todo //
+ &((Keychord){1, {{WINMOD2, XK_Return}}, togglescratch, {.ui = 0 } }), // terminal //
// SUCKLESS CONFIGS
&((Keychord){3, {{WINKEY, XK_v},{0, XK_s},{0, XK_p}}, spawn, SHCMD(TERMINAL " -n suckless -e sc-im ${THESIAH_WWW:-${HOME}/Private/git/THESIAH}/static/progs.csv") }),
diff --git a/dwm/dwm.c b/dwm/dwm.c
index 7443ac8..ae191e3 100644
--- a/dwm/dwm.c
+++ b/dwm/dwm.c
@@ -575,8 +575,9 @@ applyrules(Client *c)
XFree(ch.res_class);
if (ch.res_name)
XFree(ch.res_name);
- if (c->tags != SCRATCHPAD_MASK_1 && c->tags != SCRATCHPAD_MASK_2 && c->tags != SCRATCHPAD_MASK_3)
+ if (c->tags != SCRATCHPAD_MASK_1 && c->tags != SCRATCHPAD_MASK_2 && c->tags != SCRATCHPAD_MASK_3) {
c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : (c->mon->tagset[c->mon->seltags] & ~SPTAGMASK);
+ }
}
int
@@ -1771,10 +1772,10 @@ manage(Window w, XWindowAttributes *wa)
c->expandmask = 0;
if (!c->isfloating)
c->isfloating = c->oldstate = trans != None || c->isfixed;
- if (c->isfloating)
+ if (c->isfloating) {
XRaiseWindow(dpy, c->win);
- if (c->isfloating)
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel);
+ };
attach(c);
attachstack(c);
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
@@ -2354,12 +2355,15 @@ scratchpad_remove()
if (scratchpad_last_showed_1 == selmon->sel) {
scratchpad_last_showed_1 = NULL;
scratchpad_hide_flag--;
+ selmon->sel->isfloating = 0;
} else if (scratchpad_last_showed_2 == selmon->sel) {
scratchpad_last_showed_2 = NULL;
scratchpad_hide_flag--;
+ selmon->sel->isfloating = 0;
} else if (scratchpad_last_showed_3 == selmon->sel) {
scratchpad_last_showed_3 = NULL;
scratchpad_hide_flag--;
+ selmon->sel->isfloating = 0;
}
}
}
diff --git a/dwm/unpatched/dwm-floatrules-20210801-138b405.diff b/dwm/unpatched/dwm-floatrules-20210801-138b405.diff
new file mode 100644
index 0000000..2bf943f
--- /dev/null
+++ b/dwm/unpatched/dwm-floatrules-20210801-138b405.diff
@@ -0,0 +1,71 @@
+diff --git a/config.def.h b/config.def.h
+index a2ac963..e8c0978 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -26,9 +26,9 @@ static const Rule rules[] = {
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+- /* class instance title tags mask isfloating monitor */
+- { "Gimp", NULL, NULL, 0, 1, -1 },
+- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
++ /* class instance title tags mask isfloating monitor float x,y,w,h floatborderpx*/
++ { "Gimp", NULL, NULL, 0, 1, -1, 50,50,500,500, 5 },
++ { "Firefox", NULL, NULL, 1 << 8, 0, -1, 50,50,500,500, 5 },
+ };
+
+ /* layout(s) */
+diff --git a/dwm.c b/dwm.c
+index 5e4d494..a03ca15 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -93,6 +93,8 @@ struct Client {
+ int bw, oldbw;
+ unsigned int tags;
+ int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
++ int floatborderpx;
++ int hasfloatbw;
+ Client *next;
+ Client *snext;
+ Monitor *mon;
+@@ -139,6 +141,8 @@ typedef struct {
+ unsigned int tags;
+ int isfloating;
+ int monitor;
++ int floatx, floaty, floatw, floath;
++ int floatborderpx;
+ } Rule;
+
+ /* function declarations */
+@@ -300,6 +304,16 @@ applyrules(Client *c)
+ {
+ c->isfloating = r->isfloating;
+ c->tags |= r->tags;
++ if (r->floatborderpx >= 0) {
++ c->floatborderpx = r->floatborderpx;
++ c->hasfloatbw = 1;
++ }
++ if (r->isfloating) {
++ if (r->floatx >= 0) c->x = c->mon->mx + r->floatx;
++ if (r->floaty >= 0) c->y = c->mon->my + r->floaty;
++ if (r->floatw >= 0) c->w = r->floatw;
++ if (r->floath >= 0) c->h = r->floath;
++ }
+ for (m = mons; m && m->num != r->monitor; m = m->next);
+ if (m)
+ c->mon = m;
+@@ -1282,7 +1296,10 @@ resizeclient(Client *c, int x, int y, int w, int h)
+ c->oldy = c->y; c->y = wc.y = y;
+ c->oldw = c->w; c->w = wc.width = w;
+ c->oldh = c->h; c->h = wc.height = h;
+- wc.border_width = c->bw;
++ if (c->isfloating && c->hasfloatbw && !c->isfullscreen)
++ wc.border_width = c->floatborderpx;
++ else
++ wc.border_width = c->bw;
+ XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
+ configure(c);
+ XSync(dpy, False);
+--
+2.32.0
+