Compare commits

..

2 Commits

Author SHA1 Message Date
BitHeaven b0cfc76821 Move all layouts to layouts.c 2023-05-28 10:45:41 +05:00
BitHeaven a2751e5d2d Add steam to 5 tab 2023-05-28 10:41:16 +05:00
3 changed files with 60 additions and 61 deletions

View File

@ -53,30 +53,31 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class * WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title * WM_NAME(STRING) = title
*/ */
/* class instance title tags mask isfloating monitor */ /* class instance title tags mask isfloating monitor */
// ----- 1 ----- // ----- 1 -----
{ "st-256color", NULL, NULL, 0, 0, -1 }, { "st-256color", NULL, NULL, 0, 0, -1 },
// ----- 2 ----- // ----- 2 -----
{ "Code", NULL, NULL, 1 << 1, 0, -1 }, { "Code", NULL, NULL, 1 << 1, 0, -1 },
// ----- 3 ----- // ----- 3 -----
{ "thunderbird", NULL, NULL, 1 << 2, 0, -1 }, { "thunderbird", NULL, NULL, 1 << 2, 0, -1 },
{ "KeePassXC", NULL, NULL, 1 << 2, 0, -1 }, { "KeePassXC", NULL, NULL, 1 << 2, 0, -1 },
// ----- 4 ----- // ----- 4 -----
{ "TelegramDesktop", NULL, NULL, 1 << 3, 0, -1 }, { "TelegramDesktop", NULL, NULL, 1 << 3, 0, -1 },
{ "discord", NULL, NULL, 1 << 3, 0, -1 }, { "discord", NULL, NULL, 1 << 3, 0, -1 },
// ----- 5 ----- // ----- 5 -----
{ "Steam", NULL, NULL, 1 << 4, 0, -1 }, { "Steam", NULL, NULL, 1 << 4, 0, -1 },
{ "steamwebhelper", NULL, NULL, 1 << 4, 0, -1 }, { "steam", NULL, NULL, 1 << 4, 0, -1 },
{ "steamwebhelper", NULL, NULL, 1 << 4, 0, -1 },
// ----- 7 ----- // ----- 7 -----
{ "QjackCtl", NULL, NULL, 1 << 6, 1, -1 }, { "QjackCtl", NULL, NULL, 1 << 6, 1, -1 },
{ "PatchMatrix", NULL, NULL, 1 << 6, 0, -1 }, { "PatchMatrix", NULL, NULL, 1 << 6, 0, -1 },
{ "Blueman-manager", NULL, NULL, 1 << 6, 0, -1 }, { "Blueman-manager", NULL, NULL, 1 << 6, 0, -1 },
{ "corectrl", NULL, NULL, 1 << 6, 0, -1 }, { "corectrl", NULL, NULL, 1 << 6, 0, -1 },
// ----- 9 ----- // ----- 9 -----
{ "firefox", NULL, NULL, 1 << 8, 0, -1 }, { "firefox", NULL, NULL, 1 << 8, 0, -1 },
// ----- OTHER ----- // ----- OTHER -----
{ "xwinwrap", NULL, NULL, 1 << 9, 0, -1 }, { "xwinwrap", NULL, NULL, 1 << 9, 0, -1 },
{ NULL, NULL, "broken", 1 << 9, 0, -1 }, { NULL, NULL, "broken", 1 << 9, 0, -1 },
}; };
/* layout(s) */ /* layout(s) */

45
dwm.c
View File

@ -208,7 +208,6 @@ static void loadxrdb(void);
static void manage(Window w, XWindowAttributes *wa); static void manage(Window w, XWindowAttributes *wa);
static void mappingnotify(XEvent *e); static void mappingnotify(XEvent *e);
static void maprequest(XEvent *e); static void maprequest(XEvent *e);
static void monocle(Monitor *m);
static void motionnotify(XEvent *e); static void motionnotify(XEvent *e);
static void movemouse(const Arg *arg); static void movemouse(const Arg *arg);
static Client *nexttiled(Client *c); static Client *nexttiled(Client *c);
@ -238,7 +237,6 @@ static void sigchld(int unused);
static void spawn(const Arg *arg); static void spawn(const Arg *arg);
static void tag(const Arg *arg); static void tag(const Arg *arg);
static void tagmon(const Arg *arg); static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglebar(const Arg *arg); static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg); static void togglefloating(const Arg *arg);
static void togglefullscr(const Arg *arg); static void togglefullscr(const Arg *arg);
@ -1422,21 +1420,6 @@ maprequest(XEvent *e)
manage(ev->window, &wa); manage(ev->window, &wa);
} }
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 void
motionnotify(XEvent *e) motionnotify(XEvent *e)
{ {
@ -2058,34 +2041,6 @@ tagmon(const Arg *arg)
sendmon(selmon->sel, dirtomon(arg->i)); sendmon(selmon->sel, dirtomon(arg->i));
} }
void
tile(Monitor *m)
{
unsigned int i, n, h, mw, my, ty;
Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n == 0)
return;
if (n > m->nmaster)
mw = m->nmaster ? m->ww * m->mfact : 0;
else
mw = m->ww - m->gappx;
for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
if (i < m->nmaster) {
h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0);
if (my + HEIGHT(c) + m->gappx < m->wh)
my += HEIGHT(c) + m->gappx;
} else {
h = (m->wh - ty) / (n - i) - m->gappx;
resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0);
if (ty + HEIGHT(c) + m->gappx < m->wh)
ty += HEIGHT(c) + m->gappx;
}
}
void void
togglebar(const Arg *arg) togglebar(const Arg *arg)
{ {

View File

@ -62,3 +62,46 @@ gaplessgrid(Monitor *m) {
} }
} }
} }
void
tile(Monitor *m)
{
unsigned int i, n, h, mw, my, ty;
Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n == 0)
return;
if (n > m->nmaster)
mw = m->nmaster ? m->ww * m->mfact : 0;
else
mw = m->ww - m->gappx;
for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
if (i < m->nmaster) {
h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0);
if (my + HEIGHT(c) + m->gappx < m->wh)
my += HEIGHT(c) + m->gappx;
} else {
h = (m->wh - ty) / (n - i) - m->gappx;
resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0);
if (ty + HEIGHT(c) + m->gappx < m->wh)
ty += HEIGHT(c) + m->gappx;
}
}
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);
}