Compare commits

...

12 Commits

Author SHA1 Message Date
Sojus07
dc97dc5302 PogChamp 2025-02-11 00:01:30 +01:00
Sojus07
f5eb5cac83 poggers 2025-02-10 22:50:06 +01:00
Fabian
bcbc2e6d1d Update Makefile 2025-01-06 16:11:23 +00:00
Fabian
c370584484 Update Makefile 2025-01-06 15:25:04 +00:00
Fabian
8fc8d8a907 Update config.mk 2025-01-06 15:23:27 +00:00
fqbn207
84975dfd62 changed to pactl 2024-12-17 12:34:59 +01:00
fqbn207
2033580cef rotatestack 2024-12-17 12:27:10 +01:00
fqbn207
52d3834d10 kekl 2024-12-17 01:24:18 +01:00
memL0rz
974e7f37bf kekl 2024-12-05 14:21:34 +00:00
memL0rz
e21d1dedef removed every warning (based) 2024-12-04 00:02:37 +01:00
memL0rz
b640eb9d56 removed some warnings 2024-12-03 23:54:37 +01:00
memL0rz
00089b1bde gruvbox 2024-11-27 23:38:39 +01:00
9 changed files with 2507 additions and 39 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.ccls-cache

View File

@ -7,17 +7,21 @@ static const unsigned int gappov = 10; /* vert outer gap between window
static int smartgaps = 0; /* 1 means no outer gap when there is only one window */ static int smartgaps = 0; /* 1 means no outer gap when there is only one window */
static const int showbar = 1; /* 0 means no bar */ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */ static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "TerminessNerdFont:size=10" }; static const char *fonts[] = { "Terminus:size=10" };
static const char dmenufont[] = "TerminessNerdFont:size=10"; static const char dmenufont[] = "Terminus:size=10";
static const char col_gray1[] = "#010101";
static const char col_gray2[] = "#cc241d"; /* Farben aus Alacritty übernommen */
static const char col_gray3[] = "#ffffff"; static const char col_gray1[] = "#121212";
static const char col_gray4[] = "#eeeeee"; static const char col_gray2[] = "#ffffff";
static const char col_cyan[] = "#010101"; static const char col_gray3[] = "#dde1e6";
static const char col_gray4[] = "#ffffff";
static const char col_cyan[] = "#121212";
/* Farbschema für die Fenster und die Leiste */
static const char *colors[][3] = { static const char *colors[][3] = {
/* fg bg border */ /* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray1 }, [SchemeNorm] = { col_gray3, col_gray1, col_gray1 }, /* Normale Fenster */
[SchemeSel] = { col_gray4, col_cyan, col_gray2 }, [SchemeSel] = { col_gray4, col_cyan, col_gray2 }, /* Ausgewähltes Fenster */
}; };
/* tagging */ /* tagging */
@ -38,24 +42,25 @@ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen win
#include <X11/XF86keysym.h> #include <X11/XF86keysym.h>
static const Layout layouts[] = { static const Layout layouts[] = {
{ "|M|", centeredmaster }, { "[\\]", dwindle },
{ "[]=", tile }, /* first entry is default */ { NULL, centeredfloatingmaster },
{ "[M]", monocle }, { "|M|", centeredmaster },
{ "[@]", spiral }, { "[]=", tile }, /* first entry is default */
{ "[\\]", dwindle }, { "[M]", monocle },
{ "H[]", deck }, { "[@]", spiral },
{ "TTT", bstack }, { "H[]", deck },
{ "===", bstackhoriz }, { "TTT", bstack },
{ "HHH", grid }, { "===", bstackhoriz },
{ "###", nrowgrid }, { "HHH", grid },
{ "---", horizgrid }, { "###", nrowgrid },
{ ":::", gaplessgrid }, { "---", horizgrid },
{ "|M|", centeredmaster }, { ":::", gaplessgrid },
{ "><>", NULL }, /* no layout function means floating behavior */ { "><>", NULL }, /* no layout function means floating behavior */
{ NULL, NULL }, { NULL, NULL },
}; };
#define MODKEY Mod4Mask #define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \ #define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
@ -63,30 +68,26 @@ static const Layout layouts[] = {
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
// arrow keymaps // arrow keymaps
#define XK_Left 0xff51
#define XK_Right 0xff53
#define XK_Up 0xff56
#define XK_Down 0xff54
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *termcmd[] = { "st", NULL }; static const char *termcmd[] = { "st", NULL };
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *upvol[] = { "/usr/bin/wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%+", NULL }; static const char *upvol[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%+", NULL };
static const char *downvol[] = { "/usr/bin/wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%-", NULL }; static const char *downvol[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%-", NULL };
static const char *mutevol[] = { "/usr/bin/wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL }; static const char *mutevol[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL };
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY, XK_space, spawn, {.v = dmenucmd } }, { MODKEY, XK_space, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} }, { MODKEY|ShiftMask, XK_m, quit, {0} },
{ MODKEY, XK_Right, focusstack, {.i = +1 } }, { MODKEY, XK_Right, focusstack, {.i = +1 } },
{ MODKEY, XK_Left, focusstack, {.i = -1 } }, { MODKEY, XK_Left, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } }, { MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY|ShiftMask, XK_Left, setmfact, {.f = -0.05} }, { MODKEY, XK_r, rotatestack, {.i = -1 } },
{ MODKEY|ShiftMask, XK_Left, setmfact, {.f = -0.05} },
{ MODKEY|ShiftMask, XK_Right, setmfact, {.f = +0.05} }, { MODKEY|ShiftMask, XK_Right, setmfact, {.f = +0.05} },
{ MODKEY, XK_Tab, view, {0} }, { MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_q, killclient, {0} },
@ -97,7 +98,31 @@ static const Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
TAGKEYS( XK_1, 0) { MODKEY, XK_b, togglebar, {0} },
// Vanity Gaps shit //
{ MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} },
{ MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} },
{ MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} },
{ MODKEY|Mod1Mask, XK_u, incrgaps, {.i = +3 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_u, incrgaps, {.i = -3 } },
{ MODKEY|Mod1Mask, XK_i, incrigaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_o, incrogaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_6, incrihgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_7, incrivgaps, {.i = +5 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_7, incrivgaps, {.i = -5 } },
{ MODKEY|Mod1Mask, XK_8, incrohgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_9, incrovgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_0, togglegaps, {0} },
{ MODKEY|Mod1Mask|ShiftMask, XK_0, defaultgaps, {0} },
// WS
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1) TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2) TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3) TAGKEYS( XK_4, 3)

View File

@ -4,7 +4,7 @@ VERSION = 6.5
# Customize below to fit your system # Customize below to fit your system
# paths # paths
PREFIX = /usr/local PREFIX = /usr
MANPREFIX = ${PREFIX}/share/man MANPREFIX = ${PREFIX}/share/man
X11INC = ${PREFIX}/include X11INC = ${PREFIX}/include

55
dwm.c
View File

@ -199,6 +199,7 @@ static void resize(Client *c, int x, int y, int w, int h, int interact);
static void resizeclient(Client *c, int x, int y, int w, int h); static void resizeclient(Client *c, int x, int y, int w, int h);
static void resizemouse(const Arg *arg); static void resizemouse(const Arg *arg);
static void restack(Monitor *m); static void restack(Monitor *m);
static void rotatestack(const Arg *arg);
static void run(void); static void run(void);
static void scan(void); static void scan(void);
static int sendevent(Client *c, Atom proto); static int sendevent(Client *c, Atom proto);
@ -873,6 +874,28 @@ drawbars(void)
drawbar(m); drawbar(m);
} }
void
enqueue(Client *c)
{
Client *l;
for (l = c->mon->clients; l && l->next; l = l->next);
if (l) {
l->next = c;
c->next = NULL;
}
}
void
enqueuestack(Client *c)
{
Client *l;
for (l = c->mon->stack; l && l->snext; l = l->snext);
if (l) {
l->snext = c;
c->snext = NULL;
}
}
void void
enternotify(XEvent *e) enternotify(XEvent *e)
{ {
@ -1496,6 +1519,38 @@ restack(Monitor *m)
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
} }
void
rotatestack(const Arg *arg)
{
Client *c = NULL, *f;
if (!selmon->sel)
return;
f = selmon->sel;
if (arg->i > 0) {
for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next));
if (c){
detach(c);
attach(c);
detachstack(c);
attachstack(c);
}
} else {
if ((c = nexttiled(selmon->clients))){
detach(c);
enqueue(c);
detachstack(c);
enqueuestack(c);
}
}
if (c){
arrange(selmon);
//unfocus(f, 1);
focus(f);
restack(selmon);
}
}
void void
run(void) run(void)
{ {

2273
dwm.c.orig Normal file

File diff suppressed because it is too large Load Diff

11
dwm.c.rej Normal file
View File

@ -0,0 +1,11 @@
--- dwm.c
+++ dwm.c
@@ -165,6 +165,8 @@ static void detachstack(Client *c);
static Monitor *dirtomon(int dir);
static void drawbar(Monitor *m);
static void drawbars(void);
+static void enqueue(Client *c);
+static void enqueuestack(Client *c);
static void enternotify(XEvent *e);
static void expose(XEvent *e);
static void focus(Client *c);

0
dwm.log Normal file
View File

View File

@ -0,0 +1,102 @@
diff --git a/config.def.h b/config.def.h
index fd77a07..09737d7 100644
--- a/config.def.h
+++ b/config.def.h
@@ -64,6 +64,8 @@ static Key keys[] = {
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
+ { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
diff --git a/dwm.c b/dwm.c
index 421bf27..1ec8b10 100644
--- a/dwm.c
+++ b/dwm.c
@@ -165,6 +165,8 @@ static void detachstack(Client *c);
static Monitor *dirtomon(int dir);
static void drawbar(Monitor *m);
static void drawbars(void);
+static void enqueue(Client *c);
+static void enqueuestack(Client *c);
static void enternotify(XEvent *e);
static void expose(XEvent *e);
static void focus(Client *c);
@@ -194,6 +196,7 @@ static void resize(Client *c, int x, int y, int w, int h, int interact);
static void resizeclient(Client *c, int x, int y, int w, int h);
static void resizemouse(const Arg *arg);
static void restack(Monitor *m);
+static void rotatestack(const Arg *arg);
static void run(void);
static void scan(void);
static int sendevent(Client *c, Atom proto);
@@ -765,6 +768,28 @@ drawbars(void)
}
void
+enqueue(Client *c)
+{
+ Client *l;
+ for (l = c->mon->clients; l && l->next; l = l->next);
+ if (l) {
+ l->next = c;
+ c->next = NULL;
+ }
+}
+
+void
+enqueuestack(Client *c)
+{
+ Client *l;
+ for (l = c->mon->stack; l && l->snext; l = l->snext);
+ if (l) {
+ l->snext = c;
+ c->snext = NULL;
+ }
+}
+
+void
enternotify(XEvent *e)
{
Client *c;
@@ -1390,6 +1415,38 @@ restack(Monitor *m)
}
void
+rotatestack(const Arg *arg)
+{
+ Client *c = NULL, *f;
+
+ if (!selmon->sel)
+ return;
+ f = selmon->sel;
+ if (arg->i > 0) {
+ for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next));
+ if (c){
+ detach(c);
+ attach(c);
+ detachstack(c);
+ attachstack(c);
+ }
+ } else {
+ if ((c = nexttiled(selmon->clients))){
+ detach(c);
+ enqueue(c);
+ detachstack(c);
+ enqueuestack(c);
+ }
+ }
+ if (c){
+ arrange(selmon);
+ //unfocus(f, 1);
+ focus(f);
+ restack(selmon);
+ }
+}
+
+void
run(void)
{
XEvent ev;

View File

@ -819,4 +819,5 @@ tile(Monitor *m)
resize(c, sx, sy, sw - (2*c->bw), sh * (c->cfact / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); resize(c, sx, sy, sw - (2*c->bw), sh * (c->cfact / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0);
sy += HEIGHT(c) + ih; sy += HEIGHT(c) + ih;
} }
} }