commit 6b2d238e0e9427a4f91a85fcd2fa1f1cddcf969b
parent d0113823631d10249a70ec883def9917be5ba43d
Author: AndrewLockVI <andrew@laack.co>
Date: Sun, 16 Feb 2025 23:53:15 -0600
Added patch for attaching new windows at the bottom of the stack. I find this to be less intrusive
Diffstat:
| M | config.h | | | 33 | +++++++++++++++++++++------------ |
| M | dwm.c | | | 20 | ++++++++++++++++---- |
2 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/config.h b/config.h
@@ -35,17 +35,21 @@ static const Rule rules[] = {
};
/* layout(s) */
-static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
-static const int nmaster = 1; /* number of clients in master area */
+
+// I use an odyssey g9 so I like having one full height
+// window on the left, one in the center, and then splits on the right side
+
+static const float mfact = 0.66; /* factor of master area size [0.05..0.95] */
+static const int nmaster = 2; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const Layout layouts[] = {
/* symbol arrange function */
+ { "|||", col},
{ "[]=", tile }, /* first entry is default */
//{ "><>", NULL }, /* no layout function means floating behavior */
//{ "[M]", monocle },
- { "|||", col},
{ "|M|", centeredmaster}
};
@@ -64,13 +68,18 @@ static const Layout layouts[] = {
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
-static const char *dmenucmd[] = {"/home/andrew/bin/dmenu.sh", NULL};
-//static const char *endcmd[] = {"/home/andrew/bin/power.sh", NULL};
-static const char *passcmd[] = {"/home/andrew/bin/pass.sh", NULL};
-static const char *tmuxcmd[] = {"/home/andrew/bin/tmux.sh", NULL};
-static const char *searchcmd[] = {"/home/andrew/bin/search.sh", NULL};
-static const char *zathuracmd[] = {"/home/andrew/bin/zathura.sh", NULL};
-static const char *musiccmd[] = {"/home/andrew/bin/find-music.sh", "/home/serverBackup/fileSharing/music/" , NULL};
+// nice green color.
+static const char background[] = "#000000";
+static const char foreground[] = "#00ff00";
+static const char highlight[] = "#224422";
+
+static const char *dmenucmd[] = {"/home/andrew/bin/dmenu.sh", background, foreground, highlight, NULL};
+//static const char *endcmd[] = {"/home/andrew/bin/power.sh", background, foreground, highlight, NULL};
+static const char *passcmd[] = {"/home/andrew/bin/pass.sh", background, foreground, highlight, NULL};
+static const char *tmuxcmd[] = {"/home/andrew/bin/tmux.sh", background, foreground, highlight, NULL};
+static const char *searchcmd[] = {"/home/andrew/bin/search.sh", background, foreground, highlight, NULL};
+static const char *zathuracmd[] = {"/home/andrew/bin/zathura.sh", background, foreground, highlight, NULL};
+static const char *musiccmd[] = {"/home/andrew/bin/find-music.sh", "/home/serverBackup/fileSharing/music/" , background, foreground, highlight, NULL};
static const char *suspendcmd[] = {"/home/andrew/bin/suspend.sh" , NULL};
@@ -128,10 +137,10 @@ static const Key keys[] = {
//
// stack mode
- { MODKEY|ShiftMask, XK_v, setlayout, {.v = &layouts[0]} },
+ { MODKEY|ShiftMask, XK_v, setlayout, {.v = &layouts[1]} },
// columnar mode (awesome for odyssey g9)
- { MODKEY|ShiftMask, XK_h, setlayout, {.v = &layouts[1]} },
+ { MODKEY|ShiftMask, XK_h, setlayout, {.v = &layouts[0]} },
// centered master (good for laptop)
{ MODKEY|ShiftMask, XK_c, setlayout, {.v = &layouts[2]} },
diff --git a/dwm.c b/dwm.c
@@ -150,6 +150,7 @@ static void arrange(Monitor *m);
static void arrangemon(Monitor *m);
static void attach(Client *c);
static void attachstack(Client *c);
+static void attachbottom(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
static void cleanup(void);
@@ -413,6 +414,17 @@ attach(Client *c)
c->mon->clients = c;
}
+
+
+void
+attachbottom(Client *c)
+{
+ Client **tc;
+ c->next = NULL;
+ for (tc = &c->mon->clients; *tc; tc = &(*tc)->next);
+ *tc = c;
+}
+
void
attachstack(Client *c)
{
@@ -1070,7 +1082,7 @@ manage(Window w, XWindowAttributes *wa)
c->isfloating = c->oldstate = trans != None || c->isfixed;
if (c->isfloating)
XRaiseWindow(dpy, c->win);
- attach(c);
+ attachbottom(c);
attachstack(c);
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@@ -1209,7 +1221,7 @@ void
pop(Client *c)
{
detach(c);
- attach(c);
+ attachbottom(c);
focus(c);
arrange(c->mon);
}
@@ -1420,7 +1432,7 @@ sendmon(Client *c, Monitor *m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
+ attachbottom(c);
attachstack(c);
focus(NULL);
arrange(NULL);
@@ -1934,7 +1946,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
- attach(c);
+ attachbottom(c);
attachstack(c);
}
if (m == selmon)