aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-09-13 15:14:33 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-09-13 15:14:33 +0530
commit566d558da1c807cec184f9e44517041b30269d91 (patch)
treedf13916b7a9cfd91e9c0e261d57437d302d6c443
parent31901ae8402994a3ced350eb62f2315df5b9cebd (diff)
downloaddwm-566d558da1c807cec184f9e44517041b30269d91.tar.gz
dwm-566d558da1c807cec184f9e44517041b30269d91.tar.bz2
dwm-566d558da1c807cec184f9e44517041b30269d91.zip
dwm
-rw-r--r--config.h7
-rw-r--r--config.h.orig134
-rw-r--r--config.h.rej10
-rwxr-xr-xdwmbin79960 -> 80352 bytes
-rw-r--r--dwm.c20
-rw-r--r--dwm.c.orig7
-rw-r--r--dwm.c.rej10
-rw-r--r--dwm.obin64200 -> 65120 bytes
8 files changed, 184 insertions, 4 deletions
diff --git a/config.h b/config.h
index 3c2c157..aefaf13 100644
--- a/config.h
+++ b/config.h
@@ -66,6 +66,9 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont};
static const char *passmenucmd[] = { "passmenu", NULL};
static const char *termcmd[] = { "st", NULL };
+static const char *layoutmenu_cmd = { "layoutmenu", NULL };
+static const char *wallcmd[] = { "set_wallpaper", NULL };
+static const char *browser[] = { "firefox", NULL };
static const char *screenshot[] = {"scrot", "/home/genos/Pictures/Screenshots/%Y-%m-%d-%T-screenshot.png", NULL};
static Key keys[] = {
@@ -85,8 +88,10 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_r, togglefloating, {0} },
{ MODKEY, XK_t, setlayout, {0} },
{ MODKEY, XK_space, spawn, {.v = dmenucmd } },
+ { MODKEY|ShiftMask, XK_w, spawn, {.v = wallcmd } },
{ MODKEY, XK_p, spawn, {.v = passmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY, XK_b, spawn, {.v = browser } },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
@@ -116,7 +121,7 @@ static Key keys[] = {
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
+ { ClkLtSymbol, 0, Button3, layoutmenu, {0} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
diff --git a/config.h.orig b/config.h.orig
new file mode 100644
index 0000000..b4084b4
--- /dev/null
+++ b/config.h.orig
@@ -0,0 +1,134 @@
+/* See LICENSE file for copyright and license details. */
+
+/* appearance */
+static const unsigned int borderpx = 3; /* border pixel of windows */
+static const unsigned int gappx = 5; /* gaps between windows */
+static const unsigned int snap = 32; /* snap pixel */
+static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
+static const int showbar = 1; /* 0 means no bar */
+static const int topbar = 1; /* 0 means bottom bar */
+static const char *fonts[] = { "JetBrains Mono:size=11", "JoyPixels:pixelsize=11:antialias=true:autohint=true"};
+static const char dmenufont[] = "JetBrains Mono:size=11";
+static char normbgcolor[] = "#222222";
+static char normbordercolor[] = "#444444";
+static char normfgcolor[] = "#bbbbbb";
+static char selfgcolor[] = "#eeeeee";
+static char selbordercolor[] = "#005577";
+static char selbgcolor[] = "#005577";
+static char *colors[][3] = {
+ /* fg bg border */
+ [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
+ [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
+};
+
+/* tagging */
+static const char *tags[] = { "", "", "", "", "", "", "", "", "" };
+
+static const Rule rules[] = {
+ /* xprop(1):
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+ /* class instance title tags mask isfloating isterminal noswallow monitor */
+ { "telegram-desktop", NULL, NULL, 0, 1, 0, 0, -1 },
+ { "obs", NULL, NULL, 0, 1, 0, 0, -1 },
+ { "Lutris", NULL, NULL, 0, 1, 0, 0, -1 },
+ { "firefox", NULL, NULL, 1 << 2, 0, 0, -1, -1 },
+ { "St", NULL, NULL, 0, 0, 1, 0, -1 },
+ { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
+};
+
+/* 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 */
+static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
+
+static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
+};
+
+/* key definitions */
+#define MODKEY Mod4Mask
+#define TAGKEYS(KEY,TAG) \
+ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
+ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
+
+/* helper for spawning shell commands in the pre dwm-5.0 fashion */
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+
+/* commands */
+static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont};
+static const char *passmenucmd[] = { "passmenu", NULL};
+static const char *termcmd[] = { "st", NULL };
+static const char *wallcmd[] = { "set_wallpaper", NULL };
+static const char *browser[] = { "firefox", NULL };
+static const char *screenshot[] = {"scrot", "/home/genos/Pictures/Screenshots/%Y-%m-%d-%T-screenshot.png", NULL};
+
+static Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
+ { MODKEY, XK_k, focusstack, {.i = -1 } },
+ { MODKEY, XK_j, focusstack, {.i = +1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_g, togglebar, {0} },
+ { MODKEY, XK_f, zoom, {0} },
+ { MODKEY, XK_d, incnmaster, {.i = -1 } },
+ { MODKEY, XK_s, incnmaster, {.i = +1 } },
+ { MODKEY, XK_q, killclient, {0} },
+ { MODKEY, XK_w, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_e, setlayout, {.v = &layouts[1]} },
+ { MODKEY, XK_r, setlayout, {.v = &layouts[2]} },
+ { MODKEY|ShiftMask, XK_r, togglefloating, {0} },
+ { MODKEY, XK_t, setlayout, {0} },
+ { MODKEY, XK_space, spawn, {.v = dmenucmd } },
+ { MODKEY|ShiftMask, XK_w, spawn, {.v = wallcmd } },
+ { MODKEY, XK_p, spawn, {.v = passmenucmd } },
+ { MODKEY, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY, XK_b, spawn, {.v = browser } },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY, XK_0, view, {.ui = ~0 } },
+ { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ { MODKEY, XK_comma, focusmon, {.i = -1 } },
+ { MODKEY, XK_period, focusmon, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
+ { MODKEY, XK_minus, setgaps, {.i = -1 } },
+ { MODKEY, XK_equal, setgaps, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
+ { MODKEY, XK_F5, xrdb, {.v = NULL } },
+ { MODKEY|ShiftMask, XK_S, spawn, {.v = screenshot} },
+ TAGKEYS( XK_1, 0)
+ TAGKEYS( XK_2, 1)
+ TAGKEYS( XK_3, 2)
+ TAGKEYS( XK_4, 3)
+ TAGKEYS( XK_5, 4)
+ TAGKEYS( XK_6, 5)
+ TAGKEYS( XK_7, 6)
+ TAGKEYS( XK_8, 7)
+ TAGKEYS( XK_9, 8)
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
+};
+
+/* button definitions */
+/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
+static Button buttons[] = {
+ /* click event mask button function argument */
+ { ClkLtSymbol, 0, Button1, setlayout, {0} },
+ { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
+ { ClkWinTitle, 0, Button2, zoom, {0} },
+ { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
+ { ClkClientWin, MODKEY, Button1, movemouse, {0} },
+ { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
+ { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+ { ClkTagBar, 0, Button1, view, {0} },
+ { ClkTagBar, 0, Button3, toggleview, {0} },
+ { ClkTagBar, MODKEY, Button1, tag, {0} },
+ { ClkTagBar, MODKEY, Button3, toggletag, {0} },
+};
+
diff --git a/config.h.rej b/config.h.rej
new file mode 100644
index 0000000..a0f37e5
--- /dev/null
+++ b/config.h.rej
@@ -0,0 +1,10 @@
+--- config.def.h
++++ config.def.h
+@@ -58,6 +58,7 @@ static const Layout layouts[] = {
+ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+ 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 *termcmd[] = { "st", NULL };
++static const char *layoutmenu_cmd = "layoutmenu.sh";
+
+ static Key keys[] = {
+ /* modifier key function argument */
diff --git a/dwm b/dwm
index 5c4b7df..71f7e24 100755
--- a/dwm
+++ b/dwm
Binary files differ
diff --git a/dwm.c b/dwm.c
index 71ec76e..b592b5c 100644
--- a/dwm.c
+++ b/dwm.c
@@ -205,6 +205,7 @@ static void grabkeys(void);
static void incnmaster(const Arg *arg);
static void keypress(XEvent *e);
static void killclient(const Arg *arg);
+static void layoutmenu(const Arg *arg);
static void loadxrdb(void);
static void manage(Window w, XWindowAttributes *wa);
static void mappingnotify(XEvent *e);
@@ -1139,6 +1140,24 @@ loadxrdb()
}
void
+layoutmenu(const Arg *arg) {
+ FILE *p;
+ char c[3], *s;
+ int i;
+
+ if (!(p = popen(layoutmenu_cmd, "r")))
+ return;
+ s = fgets(c, sizeof(c), p);
+ pclose(p);
+
+ if (!s || *s == '\0' || c == '\0')
+ return;
+
+ i = atoi(c);
+ setlayout(&((Arg) { .v = &layouts[i] }));
+}
+
+void
manage(Window w, XWindowAttributes *wa)
{
Client *c, *t = NULL, *term = NULL;
@@ -2447,3 +2466,4 @@ main(int argc, char *argv[])
XCloseDisplay(dpy);
return EXIT_SUCCESS;
}
+
diff --git a/dwm.c.orig b/dwm.c.orig
index cf84ee3..71ec76e 100644
--- a/dwm.c.orig
+++ b/dwm.c.orig
@@ -811,9 +811,10 @@ drawbar(Monitor *m)
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
if (occ & 1 << i)
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- urg & 1 << i);
+ drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw,
+ m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+ urg & 1 << i);
+
x += w;
}
w = blw = TEXTW(m->ltsymbol);
diff --git a/dwm.c.rej b/dwm.c.rej
new file mode 100644
index 0000000..22217df
--- /dev/null
+++ b/dwm.c.rej
@@ -0,0 +1,10 @@
+--- dwm.c
++++ dwm.c
+@@ -177,6 +177,7 @@ static void grabkeys(void);
+ static void incnmaster(const Arg *arg);
+ static void keypress(XEvent *e);
+ static void killclient(const Arg *arg);
++static void layoutmenu(const Arg *arg);
+ static void manage(Window w, XWindowAttributes *wa);
+ static void mappingnotify(XEvent *e);
+ static void maprequest(XEvent *e);
diff --git a/dwm.o b/dwm.o
index bdf9dbb..4148f40 100644
--- a/dwm.o
+++ b/dwm.o
Binary files differ