dwm

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5e15306e77ad52992f18e494771a6027b96dab86
parent 30ef59a5420c3130a6adf6921deed159e4aab3b2
Author: AndrewLockVI <andrew@laack.co>
Date:   Mon, 17 Feb 2025 21:37:26 -0600

Updated dwm for use with tabbed

Diffstat:
Mconfig.h | 19++++++++++++-------
Mdwm.c | 65-----------------------------------------------------------------
2 files changed, 12 insertions(+), 72 deletions(-)

diff --git a/config.h b/config.h @@ -75,22 +75,23 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() // nice green color. static const char background[] = "#282828"; static const char foreground[] = "#ebdbb2"; -static const char highlight[] = "#a89984"; +static const char highlight[] = "#967762"; 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 *tmuxcmd[] = {"/home/andrew/bin/tmux.sh", background, foreground, highlight, NULL}; +static const char *tabbedcmd[] = {"/home/andrew/bin/tabbed.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 *rangercmd[] = {"/home/andrew/bin/ranger.sh", "/home/andrew/" , background, foreground, highlight, NULL}; +// static const char *rangercmd[] = {"/home/andrew/bin/ranger.sh", "/home/andrew/" , background, foreground, highlight, NULL}; static const char *screenshotcmd[] = {"/home/andrew/bin/screenshot.sh", NULL}; //static const char *suspendcmd[] = {"/home/andrew/bin/suspend.sh" , NULL}; -static const char *termcmd[] = { "st", NULL }; +static const char *termcmd[] = { "tabbed" ,"-r" , "2" , "st" ,"-w" ,"''", NULL }; #include "movestack.c" @@ -99,11 +100,15 @@ static const Key keys[] = { { MODKEY, XK_o, spawn, {.v = dmenucmd } }, { MODKEY, XK_e, spawn, {.v = endcmd } }, { MODKEY, XK_p, spawn, {.v = passcmd } }, - { MODKEY, XK_t, spawn, {.v = tmuxcmd } }, + + // don't need this anymore. I will be using tabbed because it is simpler + // and I don't need persistence when the terminal closes + //{ MODKEY, XK_t, spawn, {.v = tmuxcmd } }, { MODKEY, XK_s, spawn, {.v = searchcmd } }, { MODKEY, XK_z, spawn, {.v = zathuracmd } }, { MODKEY, XK_m, spawn, {.v = musiccmd } }, - { MODKEY, XK_r, spawn, {.v = rangercmd } }, + { MODKEY, XK_t, spawn, {.v = tabbedcmd } }, + //{ MODKEY, XK_r, spawn, {.v = rangercmd } }, { MODKEY|ShiftMask, XK_s, spawn, {.v = screenshotcmd } }, @@ -156,7 +161,7 @@ static const Key keys[] = { //{ MODKEY, XK_space, setlayout, {0} }, - //{ MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, //{ MODKEY, XK_0, view, {.ui = ~0 } }, //{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, diff --git a/dwm.c b/dwm.c @@ -185,7 +185,6 @@ static void killclient(const Arg *arg); static void manage(Window w, XWindowAttributes *wa); static void mappingnotify(XEvent *e); static void maprequest(XEvent *e); -static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); @@ -237,7 +236,6 @@ static int xerror(Display *dpy, XErrorEvent *ee); static int xerrordummy(Display *dpy, XErrorEvent *ee); static int xerrorstart(Display *dpy, XErrorEvent *ee); static void zoom(const Arg *arg); -static void centeredfloatingmaster(Monitor *m); /* variables */ static const char broken[] = "broken"; @@ -1125,21 +1123,6 @@ maprequest(XEvent *e) } void -monocle(Monitor *m) -{ - unsigned int n = 0; - Client *c; - - for (c = m->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -} - -void motionnotify(XEvent *e) { static Monitor *mon = NULL; @@ -2201,51 +2184,3 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } - -void -centeredfloatingmaster(Monitor *m) -{ - unsigned int i, n, w, mh, mw, mx, mxo, my, myo, tx; - Client *c; - - /* count number of clients in the selected monitor */ - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - /* initialize nmaster area */ - if (n > m->nmaster) { - /* go mfact box in the center if more than nmaster clients */ - if (m->ww > m->wh) { - mw = m->nmaster ? m->ww * m->mfact : 0; - mh = m->nmaster ? m->wh * 0.9 : 0; - } else { - mh = m->nmaster ? m->wh * m->mfact : 0; - mw = m->nmaster ? m->ww * 0.9 : 0; - } - mx = mxo = (m->ww - mw) / 2; - my = myo = (m->wh - mh) / 2; - } else { - /* go fullscreen if all clients are in the master area */ - mh = m->wh; - mw = m->ww; - mx = mxo = 0; - my = myo = 0; - } - - for(i = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - /* nmaster clients are stacked horizontally, in the center - * of the screen */ - w = (mw + mxo - mx) / (MIN(n, m->nmaster) - i); - resize(c, m->wx + mx, m->wy + my, w - (2*c->bw), - mh - (2*c->bw), 0); - mx += WIDTH(c); - } else { - /* stack clients are stacked horizontally */ - w = (m->ww - tx) / (n - i); - resize(c, m->wx + tx, m->wy, w - (2*c->bw), - m->wh - (2*c->bw), 0); - tx += WIDTH(c); - } -}