summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-10-13 21:46:43 +0100
committerProsperousPotato <ProsperousPotato@users.noreply.github.com>2025-10-13 21:46:43 +0100
commit178b7b559ee8b3af3d245d9c689c1b5c827a53ea (patch)
tree501faf8892536376b83cc2e3fab4004340dd18db
parent259d49c6f83446f5fb4d175658fbceed210b1c0c (diff)
add seperate border colour for master window, fix alignment issues
-rw-r--r--config.h21
-rw-r--r--dwm.c34
2 files changed, 35 insertions, 20 deletions
diff --git a/config.h b/config.h
index c74cd04..a66f122 100644
--- a/config.h
+++ b/config.h
@@ -13,10 +13,11 @@ static const int mouse_default = 0; /* 1 means enable mouse by defau
static const char col_gray1[] = "#000000";
static const char col_gray2[] = "#bbbbbb";
static const char col_float[] = "#770000";
-static const char *colors[][4] = {
- /* fg bg border float */
- [SchemeNorm] = { col_gray2, col_gray1, col_gray1, col_gray1 },
- [SchemeSel] = { col_gray1, col_gray2, col_gray2, col_float },
+static const char col_master[] = "#FF9F1C";
+static const char *colors[][5] = {
+ /* fg bg border float master */
+ [SchemeNorm] = { col_gray2, col_gray1, col_gray1, col_gray1, col_gray1 },
+ [SchemeSel] = { col_gray1, col_gray2, col_gray2, col_float, col_master },
};
static const char *const autostart[] = {
@@ -26,7 +27,7 @@ static const char *const autostart[] = {
};
/* tagging */
-static const char *tags[] = { "0", "1", "2", "3", "4" };
+static const char *tags[] = { "0", "1", "2" };
static const Rule rules[] = {
/* xprop(1):
@@ -104,8 +105,6 @@ static const Key keys[] = {
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
- TAGKEYS( XK_4, 3)
- TAGKEYS( XK_5, 4)
{ MODKEY|ShiftMask, XK_End, quit, {0} },
{ MODKEY|ShiftMask, XK_r, quit, {1} },
@@ -118,11 +117,11 @@ static const Key keys[] = {
{ MODKEY, XK_w, spawn, SHCMD(BROWSER) },
#ifdef __linux__
- { MODKEY, XK_s, spawn, SHCMD("steam") },
+ { MODKEY, XK_s, spawn, SHCMD("steam -dev") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("pkill -9 steam") },
- { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("amixer sset Master 5%+") },
- { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("amixer sset Master 5%-") },
- { 0, XF86XK_AudioMute, spawn, SHCMD("amixer sset Master toggle") },
+ { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("amixer sset Master 5%+") },
+ { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("amixer sset Master 5%-") },
+ { 0, XF86XK_AudioMute, spawn, SHCMD("amixer sset Master toggle") },
{ Mod1Mask, XK_t, spawn, SHCMD(TERMINAL" -c stfloat -e watch -n 1 transmission-remote -l") },
#endif
diff --git a/dwm.c b/dwm.c
index a883124..fc390c2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -61,6 +61,7 @@
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#define ColFloat 3
+#define ColMaster 4
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@@ -776,10 +777,14 @@ focus(Client *c)
detachstack(c);
attachstack(c);
grabbuttons(c, 1);
- if(c->isfloating)
- XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
- else
- XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
+
+ if (c == nexttiled(selmon->clients)) {
+ XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColMaster].pixel);
+ } else if(c->isfloating) {
+ XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
+ } else {
+ XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
+ }
setfocus(c);
} else {
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
@@ -1045,10 +1050,14 @@ manage(Window w, XWindowAttributes *wa)
wc.border_width = c->bw;
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- if(c->isfloating)
+
+ if (c == nexttiled(selmon->clients)) {
+ XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColMaster].pixel);
+ } else if(c->isfloating) {
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel);
- else
+ } else
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
+
configure(c); /* propagates border_width, if size doesn't change */
updatewindowtype(c);
updatesizehints(c);
@@ -1659,8 +1668,10 @@ setup(void)
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
/* init appearance */
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
- for (i = 0; i < LENGTH(colors); i++)
+ for (i = 0; i < LENGTH(colors); i++) {
scheme[i] = drw_scm_create(drw, colors[i], 4);
+ scheme[i] = drw_scm_create(drw, colors[i], 5);
+ }
/* init mouse */
if (mouse_default == 0) {
@@ -1798,8 +1809,13 @@ togglefloating(const Arg *arg)
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
if (selmon->sel->isfloating)
XSetWindowBorder(dpy, selmon->sel->win, scheme[SchemeSel][ColFloat].pixel);
- else
- XSetWindowBorder(dpy, selmon->sel->win, scheme[SchemeSel][ColBorder].pixel);
+ else {
+ if (selmon->sel == nexttiled(selmon->clients)) {
+ XSetWindowBorder(dpy, selmon->sel->win, scheme[SchemeSel][ColMaster].pixel);
+ } else {
+ XSetWindowBorder(dpy, selmon->sel->win, scheme[SchemeSel][ColBorder].pixel);
+ }
+ }
if(selmon->sel->isfloating)
resize(selmon->sel, selmon->sel->x, selmon->sel->y,
selmon->sel->w, selmon->sel->h, 0);