summaryrefslogtreecommitdiff
path: root/dwl
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2026-04-04 17:44:21 +0100
committertslil <tslil@posteo.de>2026-04-04 17:47:21 +0100
commit5413fb67d5454666cd4606ac51e8f8d1ae31aa6e (patch)
treeeffd7869b631e1e1a455b65eea1a1f12263b4bba /dwl
parent0c860a57966d4c0f4ef817b9c7f378de4623a236 (diff)
cleanup
Diffstat (limited to 'dwl')
-rw-r--r--dwl/.gitignore6
-rw-r--r--dwl/bstack.patch179
-rw-r--r--dwl/config.h197
-rw-r--r--dwl/correctly-match-blank-rule-strings.patch35
-rwxr-xr-xdwl/dwl.sh9
-rw-r--r--dwl/laptop_config.h199
-rw-r--r--dwl/pertag.patch167
-rw-r--r--dwl/rmaster.patch27
8 files changed, 0 insertions, 819 deletions
diff --git a/dwl/.gitignore b/dwl/.gitignore
deleted file mode 100644
index 0dde90e..0000000
--- a/dwl/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-dwl
-*.o
-*-protocol.c
-*-protocol.h
-.ccls-cache
-config.h
diff --git a/dwl/bstack.patch b/dwl/bstack.patch
deleted file mode 100644
index 5b20051..0000000
--- a/dwl/bstack.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 87898f8fbac5f917443d1d54e3c3797bf84a04d2 Mon Sep 17 00:00:00 2001
-From: wochap <gean.marroquin@gmail.com>
-Date: Wed, 22 Nov 2023 19:02:09 -0500
-Subject: [PATCH 1/2] apply main...Abanoub8:bottomstack.patch
-
----
- config.def.h | 4 +++
- dwl.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 88 insertions(+)
-
-diff --git a/config.def.h b/config.def.h
-index 4e30885b7..91f48d8bc 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -33,6 +33,8 @@ static const Layout layouts[] = {
- { "[]=", tile },
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-+ { "TTT", bstack },
-+ { "===", bstackhoriz },
- };
-
- /* monitors */
-@@ -132,6 +134,8 @@ static const Key keys[] = {
- { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
- { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
-+ { MODKEY, XKB_KEY_u, setlayout, {.v = &layouts[3]} },
-+ { MODKEY, XKB_KEY_o, setlayout, {.v = &layouts[4]} },
- { MODKEY, XKB_KEY_space, setlayout, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
- { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
-diff --git a/dwl.c b/dwl.c
-index a7d41b085..a6e9e125d 100644
---- a/dwl.c
-+++ b/dwl.c
-@@ -50,6 +50,7 @@
- #include <wlr/types/wlr_xdg_decoration_v1.h>
- #include <wlr/types/wlr_xdg_output_v1.h>
- #include <wlr/types/wlr_xdg_shell.h>
-+#include <wlr/util/box.h>
- #include <wlr/util/log.h>
- #include <xkbcommon/xkbcommon.h>
- #ifdef XWAYLAND
-@@ -318,6 +319,8 @@ static Monitor *xytomon(double x, double y);
- static void xytonode(double x, double y, struct wlr_surface **psurface,
- Client **pc, LayerSurface **pl, double *nx, double *ny);
- static void zoom(const Arg *arg);
-+static void bstack(Monitor *m);
-+static void bstackhoriz(Monitor *m);
-
- /* variables */
- static const char broken[] = "broken";
-@@ -2827,3 +2830,84 @@ main(int argc, char *argv[])
- usage:
- die("Usage: %s [-v] [-d] [-s startup command]", argv[0]);
- }
-+
-+static void
-+bstack(Monitor *m)
-+{
-+ int w, h, mh, mx, tx, ty, tw;
-+ unsigned int i, n = 0;
-+ Client *c;
-+
-+ wl_list_for_each(c, &clients, link)
-+ if (VISIBLEON(c, m) && !c->isfloating)
-+ n++;
-+ if (n == 0)
-+ return;
-+
-+ if (n > m->nmaster) {
-+ mh = m->nmaster ? m->mfact * m->w.height : 0;
-+ tw = m->w.width / (n - m->nmaster);
-+ ty = m->w.y + mh;
-+ } else {
-+ mh = m->w.height;
-+ tw = m->w.width;
-+ ty = m->w.y;
-+ }
-+
-+ i = mx = 0;
-+ tx = m-> w.x;
-+ wl_list_for_each(c, &clients, link) {
-+ if (!VISIBLEON(c, m) || c->isfloating)
-+ continue;
-+ if (i < m->nmaster) {
-+ w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
-+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0);
-+ mx += c->geom.width;
-+ } else {
-+ h = m->w.height - mh;
-+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = tw - (2 * c->bw), .height = h - (2 * c->bw) }, 0);
-+ if (tw != m->w.width)
-+ tx += c->geom.width;
-+ }
-+ i++;
-+ }
-+}
-+
-+static void
-+bstackhoriz(Monitor *m) {
-+ int w, mh, mx, tx, ty, th;
-+ unsigned int i, n = 0;
-+ Client *c;
-+
-+ wl_list_for_each(c, &clients, link)
-+ if (VISIBLEON(c, m) && !c->isfloating)
-+ n ++;
-+ if (n == 0)
-+ return;
-+
-+ if (n > m->nmaster) {
-+ mh = m->nmaster ? m->mfact * m->w.height : 0;
-+ th = (m->w.height - mh) / (n - m->nmaster);
-+ ty = m->w.y + mh;
-+ } else {
-+ th = mh = m->w.height;
-+ ty = m->w.y;
-+ }
-+
-+ i = mx = 0;
-+ tx = m-> w.x;
-+ wl_list_for_each(c, &clients, link) {
-+ if (!VISIBLEON(c,m) || c->isfloating)
-+ continue;
-+ if (i < m->nmaster) {
-+ w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
-+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0);
-+ mx += c->geom.width;
-+ } else {
-+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = m->w.width - (2 * c->bw), .height = th - (2 * c->bw) }, 0);
-+ if (th != m->w.height)
-+ ty += c->geom.height;
-+ }
-+ i++;
-+ }
-+}
-
-From 6d650c862e168fb6f9fbd78825945aeeca6f6270 Mon Sep 17 00:00:00 2001
-From: wochap <gean.marroquin@gmail.com>
-Date: Wed, 22 Nov 2023 19:03:00 -0500
-Subject: [PATCH 2/2] fix main...Abanoub8:bottomstack.patch, remove gaps
-
----
- dwl.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/dwl.c b/dwl.c
-index a6e9e125d..638714fdc 100644
---- a/dwl.c
-+++ b/dwl.c
-@@ -2861,11 +2861,11 @@ bstack(Monitor *m)
- continue;
- if (i < m->nmaster) {
- w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
-- resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0);
-+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w, .height = mh }, 0);
- mx += c->geom.width;
- } else {
- h = m->w.height - mh;
-- resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = tw - (2 * c->bw), .height = h - (2 * c->bw) }, 0);
-+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = tw, .height = h }, 0);
- if (tw != m->w.width)
- tx += c->geom.width;
- }
-@@ -2901,10 +2901,10 @@ bstackhoriz(Monitor *m) {
- continue;
- if (i < m->nmaster) {
- w = (m->w.width - mx) / (MIN(n, m->nmaster) - i);
-- resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w - (2 * c->bw), .height = mh - (2 * c->bw) }, 0);
-+ resize(c, (struct wlr_box) { .x = m->w.x + mx, .y = m->w.y, .width = w, .height = mh }, 0);
- mx += c->geom.width;
- } else {
-- resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = m->w.width - (2 * c->bw), .height = th - (2 * c->bw) }, 0);
-+ resize(c, (struct wlr_box) { .x = tx, .y = ty, .width = m->w.width, .height = th }, 0);
- if (th != m->w.height)
- ty += c->geom.height;
- }
diff --git a/dwl/config.h b/dwl/config.h
deleted file mode 100644
index 5c2acf9..0000000
--- a/dwl/config.h
+++ /dev/null
@@ -1,197 +0,0 @@
-static int log_level = WLR_ERROR;
-
-/* Taken from https://github.com/djpohly/dwl/issues/466 */
-#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
- ((hex >> 16) & 0xFF) / 255.0f, \
- ((hex >> 8) & 0xFF) / 255.0f, \
- (hex & 0xFF) / 255.0f }
-
-/* appearance */
-static const int sloppyfocus = 1; /* focus follows mouse */
-static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
-static const unsigned int gap = 10; /* inner gap between windows */
-static const float bordercolor[] = {0.266, 0.266, 0.266, 1.0}; // 44 44 44
-static const float focuscolor[] = {1.000, 0.549, 0.000, 1.0}; // ff 8c 00
-static const float urgentcolor[] = COLOR(0xff0000ff);
-/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
-static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
-
-/* tagging */
-#define TAGCOUNT 8
-
-static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor keep_focus */
-// { "firefox", "DWL_EMPTY_TITLE", 0, 1, -1 },
-// { "firefox", "Firefox — Sharing Indicator", 0, 1, -1 }
- { NULL, NULL, 0, 0, -1 }
-};
-
-/* layout(s) */
-static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile },
- { "[M]", monocle },
- { "===", bstackhoriz },
- { "TTT", bstack },
- { "><>", NULL }, /* no layout function means floating behavior */
-};
-
-/* monitors */
-static const MonitorRule monrules[] = {
- /* name mfact nmaster scale layout rotate/reflect x y*/
- { "DP-3", 0.6, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
- { "DP-1", 0.6, 1, 1, &layouts[2], WL_OUTPUT_TRANSFORM_90, -1, -1 },
- /* defaults */
- { NULL, 0.6, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
-};
-
-/* keyboard */
-static const struct xkb_rule_names xkb_rules = {
- /* can specify fields: rules, model, layout, variant, options */
- /* example:
- .options = "ctrl:nocaps",
- */
- .options = NULL,
-};
-
-static const int repeat_rate = 25;
-static const int repeat_delay = 600;
-
-/* Trackpad */
-static const int tap_to_click = 1;
-static const int tap_and_drag = 1;
-static const int drag_lock = 1;
-static const int natural_scrolling = 0;
-static const int disable_while_typing = 1;
-static const int left_handed = 0;
-static const int middle_button_emulation = 0;
-/* You can choose between:
-LIBINPUT_CONFIG_SCROLL_NO_SCROLL
-LIBINPUT_CONFIG_SCROLL_2FG
-LIBINPUT_CONFIG_SCROLL_EDGE
-LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
-*/
-static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
-
-/* You can choose between:
-LIBINPUT_CONFIG_CLICK_METHOD_NONE
-LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
-LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
-*/
-static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
-
-/* You can choose between:
-LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
-LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
-LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
-*/
-static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
-
-/* You can choose between:
-LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
-LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
-*/
-static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
-static const double accel_speed = 0.0;
-/* You can choose between:
-LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
-LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
-*/
-static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
-
-/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
-#define MODKEY WLR_MODIFIER_LOGO
-
-#define TAGKEYS(KEY,SKEY,TAG) \
- { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,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 const char *termcmd[] = { "foot", NULL };
-static const char *menucmd[] = { "run", NULL };
-static const char *now_playing[] = { "now_playing", NULL };
-static const char *albumbler[] = { "albumbler.py", NULL };
-static const char *mpc_toggle[] = { "mpc", "toggle", NULL };
-static const char *mpc_next[] = { "mpc", "next", NULL };
-static const char *mpc_prev[] = { "mpc", "prev", NULL };
-static const char *mpc_stop[] = { "mpc", "stop", NULL };
-static const char *slock[] = { "lock", NULL };
-static const char *flameshot[] = { "grim_slurp", NULL };
-
-static const char *vol_dn[] = { "pactl", "set-sink-volume", "0", "-2%", NULL };
-static const char *vol_up[] = { "pactl", "set-sink-volume", "0", "+2%", NULL };
-static const char *vol_mt[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
-
-static const Key keys[] = {
- /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
- { MODKEY, XKB_KEY_t, spawn, {.v = termcmd} },
- { MODKEY, XKB_KEY_d, spawn, {.v = menucmd} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, spawn, {.v = albumbler } },
- { MODKEY|WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_space, spawn, {.v = now_playing } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_X, spawn, {.v = slock } },
- { MODKEY, XKB_KEY_p, spawn, {.v = flameshot } },
- { MODKEY|WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_Q, quit, {0} },
-
- // Multimedia
- { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = vol_dn } },
- { 0, XKB_KEY_XF86AudioMute, spawn, {.v = vol_mt } },
- { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = vol_up } },
- { 0, XKB_KEY_XF86AudioPlay, spawn, {.v = mpc_toggle } },
- { 0, XKB_KEY_XF86AudioStop, spawn, {.v = mpc_stop } },
- { 0, XKB_KEY_XF86AudioPrev, spawn, {.v = mpc_prev } },
- { 0, XKB_KEY_XF86AudioNext, spawn, {.v = mpc_next } },
-
- // Windows
- { MODKEY, XKB_KEY_c, focusstack, {.i = +1 } },
- { MODKEY, XKB_KEY_i, focusstack, {.i = -1 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, incnmaster, {.i = +1 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_I, incnmaster, {.i = -1 } },
- { MODKEY, XKB_KEY_e, setmfact, {.f = -0.05} },
- { MODKEY, XKB_KEY_n, setmfact, {.f = +0.05} },
- { MODKEY, XKB_KEY_Return, zoom, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, killclient, {0} },
-
- // Layout
- { MODKEY, XKB_KEY_s, setlayout, {.v = &layouts[0]} },
- { MODKEY, XKB_KEY_r, setlayout, {.v = &layouts[1]} },
- { MODKEY, XKB_KEY_a, setlayout, {.v = &layouts[2]} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S, setlayout, {.v = &layouts[3]} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_R, setlayout, {.v = &layouts[4]} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_A, togglefloating, {0} },
- { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_RIGHT } },
- { MODKEY, XKB_KEY_b, focusmon, {.i = WLR_DIRECTION_LEFT } },
-
- // Tags
- { MODKEY, XKB_KEY_0, view, {.ui = ~0 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright,tag, {.ui = ~0 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_RIGHT } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_B, tagmon, {.i = WLR_DIRECTION_LEFT } },
- { MODKEY, XKB_KEY_Tab, view, {.ui = 0 } },
- TAGKEYS( XKB_KEY_f, XKB_KEY_F, 0),
- TAGKEYS( XKB_KEY_u, XKB_KEY_U, 1),
- TAGKEYS( XKB_KEY_h, XKB_KEY_H, 2),
- TAGKEYS( XKB_KEY_period, XKB_KEY_greater, 3),
- TAGKEYS( XKB_KEY_v, XKB_KEY_V, 4),
- TAGKEYS( XKB_KEY_l, XKB_KEY_L, 5),
- TAGKEYS( XKB_KEY_o, XKB_KEY_O, 6),
- TAGKEYS( XKB_KEY_m, XKB_KEY_M, 7),
-
- /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
- { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
-#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
- CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
- CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
-};
-
-static const Button buttons[] = {
- { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
- { MODKEY, BTN_MIDDLE, togglefloating, {0} },
- { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
-};
diff --git a/dwl/correctly-match-blank-rule-strings.patch b/dwl/correctly-match-blank-rule-strings.patch
deleted file mode 100644
index f9b3144..0000000
--- a/dwl/correctly-match-blank-rule-strings.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 7cc541eb1092ba17bfe3d5afa77e609cda832016 Mon Sep 17 00:00:00 2001
-From: tslil clingman <>
-Date: Sat, 2 Dec 2023 10:57:35 +0100
-Subject: [PATCH 1/1] correctly match blank rule strings
-
-The bug before-hand was that specifying a blank rule string would
-match against any string (strstr(foo, "") is always true apparently),
-even though we already had a special case for !r->title and !r->id.
-
-This patch now sets the behaviour to r->title/r->id == NULL means
-match all, blank means match blank
----
- dwl.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/dwl.c b/dwl.c
-index 03e999e..5a2a538 100644
---- a/dwl.c
-+++ b/dwl.c
-@@ -442,9 +442,10 @@ applyrules(Client *c)
- if (!(title = client_get_title(c)))
- title = broken;
-
-+#define MATCH(str1, str2) ((str2[0]==0 && str1[0]==0) || (str2[0] != 0 && strstr(str1, str2)))
- for (r = rules; r < END(rules); r++) {
-- if ((!r->title || strstr(title, r->title))
-- && (!r->id || strstr(appid, r->id))) {
-+ if ((!r->title || MATCH(title, r->title))
-+ && (!r->id || MATCH(appid, r->id))) {
- c->isfloating = r->isfloating;
- newtags |= r->tags;
- i = 0;
---
-2.43.0
-
diff --git a/dwl/dwl.sh b/dwl/dwl.sh
deleted file mode 100755
index 190db66..0000000
--- a/dwl/dwl.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-killall dunst; dunst &
-
-swaybg -o DP-3 -i /home/tslil/store/pictures/dp3_back &
-swaybg -o DP-1 -m tile -i /home/tslil/store/pictures/dp1_back &
-
-yambar &
-cat - > /home/tslil/.cache/dwltags
diff --git a/dwl/laptop_config.h b/dwl/laptop_config.h
deleted file mode 100644
index fcce62e..0000000
--- a/dwl/laptop_config.h
+++ /dev/null
@@ -1,199 +0,0 @@
-static int log_level = WLR_ERROR;
-
-/* Taken from https://github.com/djpohly/dwl/issues/466 */
-#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
- ((hex >> 16) & 0xFF) / 255.0f, \
- ((hex >> 8) & 0xFF) / 255.0f, \
- (hex & 0xFF) / 255.0f }
-
-/* appearance */
-static const int sloppyfocus = 1; /* focus follows mouse */
-static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
-static const float bordercolor[] = {0.266, 0.266, 0.266, 1.0}; // 44 44 44
-static const float focuscolor[] = {1.000, 0.549, 0.000, 1.0}; // ff 8c 00
-static const float urgentcolor[] = COLOR(0xff0000ff);
-static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
-
-/* tagging */
-#define TAGCOUNT 8
-
-static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */
- { "firefox", "", 0, 1, -1 }
-};
-
-/* layout(s) */
-static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile },
- { "[M]", monocle },
- { "===", bstackhoriz },
- { "TTT", bstack },
- { "><>", NULL }, /* no layout function means floating behavior */
-};
-
-/* monitors */
-static const MonitorRule monrules[] = {
- /* name mfact nmaster scale layout rotate/reflect x y*/
- { NULL, 0.6, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
-};
-
-/* keyboard */
-static const struct xkb_rule_names xkb_rules = {
- /* can specify fields: rules, model, layout, variant, options */
- /* example:
- .options = "ctrl:nocaps",
- */
- .model = "pc105awide",
- .layout = "vlom",
- .options = "ctrl:nocaps,ctrl:swap_lalt_lctl_lwin,ctrl:swap_rwin_rctl",
-};
-
-static const int repeat_rate = 25;
-static const int repeat_delay = 600;
-
-/* Trackpad */
-static const int tap_to_click = 1;
-static const int tap_and_drag = 1;
-static const int drag_lock = 1;
-static const int natural_scrolling = 0;
-static const int disable_while_typing = 1;
-static const int left_handed = 0;
-static const int middle_button_emulation = 0;
-/* You can choose between:
-LIBINPUT_CONFIG_SCROLL_NO_SCROLL
-LIBINPUT_CONFIG_SCROLL_2FG
-LIBINPUT_CONFIG_SCROLL_EDGE
-LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
-*/
-static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
-
-/* You can choose between:
-LIBINPUT_CONFIG_CLICK_METHOD_NONE
-LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
-LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
-*/
-static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
-
-/* You can choose between:
-LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
-LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
-LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
-*/
-static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
-
-/* You can choose between:
-LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
-LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
-*/
-static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
-static const double accel_speed = 0.0;
-/* You can choose between:
-LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
-LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
-*/
-static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
-
-/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
-#define MODKEY WLR_MODIFIER_LOGO
-
-#define TAGKEYS(KEY,SKEY,TAG) \
- { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,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 const char *termcmd[] = { "foot", NULL };
-static const char *menucmd[] = { "run", NULL };
-static const char *now_playing[] = { "now_playing", NULL };
-static const char *albumbler[] = { "albumbler.py", NULL };
-static const char *mpc_toggle[] = { "mpc", "toggle", NULL };
-static const char *mpc_next[] = { "mpc", "next", NULL };
-static const char *mpc_prev[] = { "mpc", "prev", NULL };
-static const char *mpc_stop[] = { "mpc", "stop", NULL };
-static const char *slock[] = { "lock", NULL };
-static const char *flameshot[] = { "grim_slurp", NULL };
-
-static const char *vol_dn[] = { "pactl", "set-sink-volume", "0", "-2%", NULL };
-static const char *vol_up[] = { "pactl", "set-sink-volume", "0", "+2%", NULL };
-static const char *vol_mt[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
-
-static const char *light_up[] = { "light", "-A", "5", NULL };
-static const char *light_dn[] = { "light", "-U", "5", NULL };
-
-static const Key keys[] = {
- /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
- { MODKEY, XKB_KEY_t, spawn, {.v = termcmd} },
- { MODKEY, XKB_KEY_d, spawn, {.v = menucmd} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, spawn, {.v = albumbler } },
- { MODKEY|WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_space, spawn, {.v = now_playing } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_X, spawn, {.v = slock } },
- { MODKEY, XKB_KEY_p, spawn, {.v = flameshot } },
- { MODKEY|WLR_MODIFIER_SHIFT|WLR_MODIFIER_CTRL, XKB_KEY_Q, quit, {0} },
-
- // Multimedia
- { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = vol_dn } },
- { 0, XKB_KEY_XF86AudioMute, spawn, {.v = vol_mt } },
- { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = vol_up } },
- { 0, XKB_KEY_XF86AudioPlay, spawn, {.v = mpc_toggle } },
- { 0, XKB_KEY_XF86AudioStop, spawn, {.v = mpc_stop } },
- { 0, XKB_KEY_XF86AudioPrev, spawn, {.v = mpc_prev } },
- { 0, XKB_KEY_XF86AudioNext, spawn, {.v = mpc_next } },
-
- // Brightness
- { 0, XKB_KEY_XF86MonBrightnessUp, spawn, {.v = light_up }},
- { 0, XKB_KEY_XF86MonBrightnessDown, spawn, {.v = light_dn }},
-
- // Windows
- { MODKEY, XKB_KEY_c, focusstack, {.i = +1 } },
- { MODKEY, XKB_KEY_i, focusstack, {.i = -1 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, incnmaster, {.i = +1 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_I, incnmaster, {.i = -1 } },
- { MODKEY, XKB_KEY_e, setmfact, {.f = -0.05} },
- { MODKEY, XKB_KEY_n, setmfact, {.f = +0.05} },
- { MODKEY, XKB_KEY_Return, zoom, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, killclient, {0} },
-
- // Layout
- { MODKEY, XKB_KEY_s, setlayout, {.v = &layouts[0]} },
- { MODKEY, XKB_KEY_r, setlayout, {.v = &layouts[1]} },
- { MODKEY, XKB_KEY_a, setlayout, {.v = &layouts[2]} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S, setlayout, {.v = &layouts[3]} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_R, setlayout, {.v = &layouts[4]} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_A, togglefloating, {0} },
- { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_RIGHT } },
- { MODKEY, XKB_KEY_b, focusmon, {.i = WLR_DIRECTION_LEFT } },
-
- // Tags
- { MODKEY, XKB_KEY_0, view, {.ui = ~0 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright,tag, {.ui = ~0 } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_RIGHT } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_B, tagmon, {.i = WLR_DIRECTION_LEFT } },
- { MODKEY, XKB_KEY_Tab, view, {.ui = 0 } },
- TAGKEYS( XKB_KEY_f, XKB_KEY_F, 0),
- TAGKEYS( XKB_KEY_u, XKB_KEY_U, 1),
- TAGKEYS( XKB_KEY_h, XKB_KEY_H, 2),
- TAGKEYS( XKB_KEY_period, XKB_KEY_greater, 3),
- TAGKEYS( XKB_KEY_v, XKB_KEY_V, 4),
- TAGKEYS( XKB_KEY_l, XKB_KEY_L, 5),
- TAGKEYS( XKB_KEY_o, XKB_KEY_O, 6),
- TAGKEYS( XKB_KEY_m, XKB_KEY_M, 7),
-
- /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
- { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
-#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
- CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
- CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
-};
-
-static const Button buttons[] = {
- { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
- { MODKEY, BTN_MIDDLE, togglefloating, {0} },
- { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
-};
diff --git a/dwl/pertag.patch b/dwl/pertag.patch
deleted file mode 100644
index a0c66d8..0000000
--- a/dwl/pertag.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 8750e1255f6c8b799165186cd6cfdfa7af3ee56d Mon Sep 17 00:00:00 2001
-From: mortezadadgar <mortezadadgar97@gmail.com>
-Date: Sat, 26 Aug 2023 20:37:22 +0330
-Subject: [PATCH] Applied pertag
-
----
- dwl.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
- 1 file changed, 70 insertions(+), 5 deletions(-)
-
-diff --git a/dwl.c b/dwl.c
-index 4ff5c37f7..6c104bbb0 100644
---- a/dwl.c
-+++ b/dwl.c
-@@ -94,6 +94,7 @@ typedef struct {
- const Arg arg;
- } Button;
-
-+typedef struct Pertag Pertag;
- typedef struct Monitor Monitor;
- typedef struct {
- /* Must keep these three elements in this order */
-@@ -185,6 +186,7 @@ struct Monitor {
- struct wlr_box w; /* window area, layout-relative */
- struct wl_list layers[4]; /* LayerSurface::link */
- const Layout *lt[2];
-+ Pertag *pertag;
- unsigned int seltags;
- unsigned int sellt;
- uint32_t tagset[2];
-@@ -413,6 +415,14 @@ static Atom netatom[NetLast];
- /* attempt to encapsulate suck into one file */
- #include "client.h"
-
-+struct Pertag {
-+ unsigned int curtag, prevtag; /* current and previous tag */
-+ int nmasters[TAGCOUNT + 1]; /* number of windows in master area */
-+ float mfacts[TAGCOUNT + 1]; /* mfacts per tag */
-+ unsigned int sellts[TAGCOUNT + 1]; /* selected layouts */
-+ const Layout *ltidxs[TAGCOUNT + 1][2]; /* matrix of tags and layouts indexes */
-+};
-+
- /* function implementations */
- void
- applybounds(Client *c, struct wlr_box *bbox)
-@@ -703,6 +713,7 @@ cleanupmon(struct wl_listener *listener, void *data)
- wlr_scene_output_destroy(m->scene_output);
- wlr_scene_node_destroy(&m->fullscreen_bg->node);
-
-+ free(m->pertag);
- closemon(m);
- free(m);
- }
-@@ -944,6 +955,18 @@ createmon(struct wl_listener *listener, void *data)
- wl_list_insert(&mons, &m->link);
- printstatus();
-
-+ m->pertag = calloc(1, sizeof(Pertag));
-+ m->pertag->curtag = m->pertag->prevtag = 1;
-+
-+ for (i = 0; i <= TAGCOUNT; i++) {
-+ m->pertag->nmasters[i] = m->nmaster;
-+ m->pertag->mfacts[i] = m->mfact;
-+
-+ m->pertag->ltidxs[i][0] = m->lt[0];
-+ m->pertag->ltidxs[i][1] = m->lt[1];
-+ m->pertag->sellts[i] = m->sellt;
-+ }
-+
- /* The xdg-protocol specifies:
- *
- * If the fullscreened surface is not opaque, the compositor must make
-@@ -1355,7 +1378,7 @@ incnmaster(const Arg *arg)
- {
- if (!arg || !selmon)
- return;
-- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
-+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
- arrange(selmon);
- }
-
-@@ -2060,9 +2083,9 @@ setlayout(const Arg *arg)
- if (!selmon)
- return;
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
-- selmon->sellt ^= 1;
-+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
- if (arg && arg->v)
-- selmon->lt[selmon->sellt] = (Layout *)arg->v;
-+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
- strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
- arrange(selmon);
- printstatus();
-@@ -2079,7 +2102,7 @@ setmfact(const Arg *arg)
- f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
- if (f < 0.1 || f > 0.9)
- return;
-- selmon->mfact = f;
-+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
- arrange(selmon);
- }
-
-@@ -2423,10 +2446,30 @@ void
- toggleview(const Arg *arg)
- {
- uint32_t newtagset = selmon ? selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK) : 0;
-+ size_t i;
-
- if (!newtagset)
- return;
-
-+ if (newtagset == ~0) {
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+ selmon->pertag->curtag = 0;
-+ }
-+
-+ /* test if the user did not select the same tag */
-+ if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+ for (i = 0; !(newtagset & 1 << i); i++) ;
-+ selmon->pertag->curtag = i + 1;
-+ }
-+
-+ /* apply settings for this view */
-+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
-+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
-+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
-+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
-+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
-+
- selmon->tagset[selmon->seltags] = newtagset;
- focusclient(focustop(selmon), 1);
- arrange(selmon);
-@@ -2596,11 +2639,33 @@ urgent(struct wl_listener *listener, void *data)
- void
- view(const Arg *arg)
- {
-+ size_t i, tmptag;
-+
- if (!selmon || (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
- return;
- selmon->seltags ^= 1; /* toggle sel tagset */
-- if (arg->ui & TAGMASK)
-+ if (arg->ui & TAGMASK) {
- selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+
-+ if (arg->ui == ~0)
-+ selmon->pertag->curtag = 0;
-+ else {
-+ for (i = 0; !(arg->ui & 1 << i); i++) ;
-+ selmon->pertag->curtag = i + 1;
-+ }
-+ } else {
-+ tmptag = selmon->pertag->prevtag;
-+ selmon->pertag->prevtag = selmon->pertag->curtag;
-+ selmon->pertag->curtag = tmptag;
-+ }
-+
-+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
-+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
-+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
-+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
-+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
-+
- focusclient(focustop(selmon), 1);
- arrange(selmon);
- printstatus();
diff --git a/dwl/rmaster.patch b/dwl/rmaster.patch
deleted file mode 100644
index f6afd59..0000000
--- a/dwl/rmaster.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From fb5d9aab92bf5eae32b62d345290f61fec08a2fe Mon Sep 17 00:00:00 2001
-From: tslil clingman
-Date: Sun, 26 Nov 2023 16:38:01 +0100
-Subject: [PATCH] rmaster
-
----
- dwl.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/dwl.c b/dwl.c
-index 47e238e..3e9bd4a 100644
---- a/dwl.c
-+++ b/dwl.c
-@@ -2451,11 +2451,11 @@ tile(Monitor *m)
- if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
- continue;
- if (i < m->nmaster) {
-- resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw,
-+ resize(c, (struct wlr_box){.x = m->w.x + m->w.width - mw, .y = m->w.y + my, .width = mw,
- .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0);
- my += c->geom.height;
- } else {
-- resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
-+ resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + ty,
- .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0);
- ty += c->geom.height;
- }