commit 6a7e435c1c23c7223758d1d06fe73a7ecd7da16f
parent 21592f1a1e9fc10577145e95b1bed20828d5eee2
Author: AndrewLockVI <andrew@laack.co>
Date: Sun, 23 Feb 2025 16:42:05 -0600
Added patch to attach at bottom instead of next. I find this is what I was doing anyways with attach below so might as well simplify. Also, I realized it is harder to implement attach aside in dvtm and I want consistency so... yeah.
Diffstat:
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/config.h b/config.h
@@ -100,6 +100,7 @@ static const char *workspacecmd[] = {"/home/andrew/bin/init-screen.sh", NULL};
static const char *bookmarkscmd[] = {"/home/andrew/bin/bookmarks.sh", NULL};
static const char *addbookmarkcmd[] = {"/home/andrew/bin/add-bookmark.sh", NULL};
static const char *openbookmarkcmd[] = {"/home/andrew/bin/open-bookmark.sh", NULL};
+static const char *openlibrewolfcmd[] = {"librewolf", NULL};
static const char *screenshotcmd[] = {"/home/andrew/bin/screenshot.sh", NULL};
@@ -145,6 +146,7 @@ static const Key keys[] = {
// add bookmark
{ MODKEY|ShiftMask, XK_b, spawn, {.v = addbookmarkcmd} },
{ MODKEY|ShiftMask, XK_s, spawn, {.v = screenshotcmd } },
+ { MODKEY|ShiftMask, XK_l, spawn, {.v = openlibrewolfcmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
diff --git a/dwm.c b/dwm.c
@@ -149,7 +149,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac
static void arrange(Monitor *m);
static void arrangemon(Monitor *m);
static void attach(Client *c);
-static void attachBelow(Client *c);
+static void attachbottom(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@@ -413,19 +413,12 @@ attach(Client *c)
void
-attachBelow(Client *c)
+attachbottom(Client *c)
{
- //If there is nothing on the monitor or the selected client is floating, attach as normal
- if(c->mon->sel == NULL || c->mon->sel == c || c->mon->sel->isfloating) {
- attach(c);
- return;
- }
-
- //Set the new client's next property to the same as the currently selected clients next
- c->next = c->mon->sel->next;
- //Set the currently selected clients next property to the new client
- c->mon->sel->next = c;
-
+ Client **tc;
+ c->next = NULL;
+ for (tc = &c->mon->clients; *tc; tc = &(*tc)->next);
+ *tc = c;
}
@@ -1088,7 +1081,7 @@ manage(Window w, XWindowAttributes *wa)
c->isfloating = c->oldstate = trans != None || c->isfixed;
if (c->isfloating)
XRaiseWindow(dpy, c->win);
- attachBelow(c);
+ attachbottom(c);
attachstack(c);
XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
(unsigned char *) &(c->win), 1);
@@ -1212,7 +1205,7 @@ void
pop(Client *c)
{
detach(c);
- attachBelow(c);
+ attach(c);
focus(c);
arrange(c->mon);
}
@@ -1423,7 +1416,7 @@ sendmon(Client *c, Monitor *m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attachBelow(c);
+ attachbottom(c);
attachstack(c);
focus(NULL);
arrange(NULL);
@@ -1938,7 +1931,7 @@ updategeom(void)
m->clients = c->next;
detachstack(c);
c->mon = mons;
- attachBelow(c);
+ attachbottom(c);
attachstack(c);
}
if (m == selmon)