diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-06-28 15:51:24 +0200 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2025-07-08 22:12:08 +0200 |
| commit | 2172fcf4a7db657687d634ca729372f8ba47f85e (patch) | |
| tree | 299a44d95288d8bd1275af548857daa7d335d49d | |
| parent | f570a251a00b286ac0aa11b8d4a1008edd172bd9 (diff) | |
| -rw-r--r-- | config.h | 12 | ||||
| -rw-r--r-- | dwm.c | 11 | ||||
| -rw-r--r-- | patches/dwm-focusonnetactive-6.2.diff | 57 |
3 files changed, 72 insertions, 8 deletions
@@ -3,7 +3,7 @@ /* Constants */ #define TERMINAL "st" #define TERMCLASS "St" -#define BROWSER "librewolf" +#define BROWSER "firefox" /* appearance */ static unsigned int borderpx = 3; /* border pixel of windows */ @@ -21,7 +21,7 @@ static char normbgcolor[] = "#222222"; static char normbordercolor[] = "#444444"; static char normfgcolor[] = "#bbbbbb"; static char selfgcolor[] = "#eeeeee"; -static char selbordercolor[] = "#770000"; +static char selbordercolor[] = "#17293d"; static char selbgcolor[] = "#005577"; static char *colors[][3] = { /* fg bg border */ @@ -212,13 +212,13 @@ static const Key keys[] = { { MODKEY, XK_z, incrgaps, {.i = +3 } }, /* { MODKEY|ShiftMask, XK_z, spawn, SHCMD("") }, */ { MODKEY, XK_x, incrgaps, {.i = -3 } }, - /* { MODKEY|ShiftMask, XK_x, spawn, SHCMD("") }, */ + { MODKEY|ShiftMask, XK_x, spawn, {.v = (const char*[]){ "kx", NULL } } }, { MODKEY, XK_c, spawn, {.v = (const char*[]){ TERMINAL, "-e", "profanity", NULL } } }, - /* { MODKEY|ShiftMask, XK_c, spawn, SHCMD("") }, */ + { MODKEY|ShiftMask, XK_c, spawn, {.v = (const char*[]){ TERMINAL, "-e", "tiny", NULL } } }, /* V is automatically bound above in STACKKEYS */ { MODKEY, XK_b, togglebar, {0} }, /* { MODKEY|ShiftMask, XK_b, spawn, SHCMD("") }, */ - { MODKEY, XK_n, spawn, {.v = (const char*[]){ TERMINAL, "-e", "nvim", "-c", "VimwikiIndex", NULL } } }, + { MODKEY, XK_n, spawn, {.v = (const char*[]){ TERMINAL, "-e", "kn" , NULL } } }, { MODKEY|ShiftMask, XK_n, spawn, SHCMD(TERMINAL " -e newsboat ; pkill -RTMIN+6 dwmblocks") }, { MODKEY, XK_m, spawn, {.v = (const char*[]){ TERMINAL, "-e", "ncmpcpp", NULL } } }, { MODKEY|ShiftMask, XK_m, spawn, SHCMD("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; kill -44 $(pidof dwmblocks)") }, @@ -253,7 +253,7 @@ static const Key keys[] = { { MODKEY, XK_space, zoom, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { 0, XK_Print, spawn, SHCMD("maim pic-full-$(date '+%y%m%d-%H%M-%S').png") }, + { 0, XK_Print, spawn, SHCMD("maim -q -d 0.2 -i \"$(xdotool getactivewindow)\" | xclip -f -t image/png | xclip -sel c -t image/png ") }, { ShiftMask, XK_Print, spawn, {.v = (const char*[]){ "maimpick", NULL } } }, { MODKEY, XK_Print, spawn, {.v = (const char*[]){ "dmenurecord", NULL } } }, { MODKEY|ShiftMask, XK_Print, spawn, {.v = (const char*[]){ "dmenurecord", "kill", NULL } } }, @@ -669,6 +669,7 @@ clientmessage(XEvent *e) { XClientMessageEvent *cme = &e->xclient; Client *c = wintoclient(cme->window); + unsigned int i; if (!c) return; @@ -678,8 +679,14 @@ clientmessage(XEvent *e) setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); } else if (cme->message_type == netatom[NetActiveWindow]) { - if (c != selmon->sel && !c->isurgent) - seturgent(c, 1); + for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); + if (i < LENGTH(tags)) { + const Arg a = {.ui = 1 << i}; + selmon = c->mon; + view(&a); + focus(c); + restack(selmon); + } } } diff --git a/patches/dwm-focusonnetactive-6.2.diff b/patches/dwm-focusonnetactive-6.2.diff new file mode 100644 index 0000000..5d358d2 --- /dev/null +++ b/patches/dwm-focusonnetactive-6.2.diff @@ -0,0 +1,57 @@ +From 286ca3bb1af08b452bf8140abcc23d4ef61baaa2 Mon Sep 17 00:00:00 2001 +From: bakkeby <bakkeby@gmail.com> +Date: Tue, 7 Apr 2020 12:33:04 +0200 +Subject: [PATCH] Activate a window in response to _NET_ACTIVE_WINDOW + +By default, dwm response to client requests to _NET_ACTIVE_WINDOW client +messages by setting the urgency bit on the named window. + +This patch activates the window instead. + +Both behaviours are legitimate according to +https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472702304 + +One should decide which of these one should perform based on the message +senders' untestable claims that it represents the end-user. Setting the +urgency bit is the conservative decision. This patch implements the more +trusting alternative. + +It also allows dwm to work with `wmctrl -a` and other external window +management utilities + +--- + dwm.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/dwm.c b/dwm.c +index 4465af1..3919d47 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -514,6 +514,7 @@ clientmessage(XEvent *e) + { + XClientMessageEvent *cme = &e->xclient; + Client *c = wintoclient(cme->window); ++ unsigned int i; + + if (!c) + return; +@@ -523,8 +524,14 @@ clientmessage(XEvent *e) + setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ + || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); + } else if (cme->message_type == netatom[NetActiveWindow]) { +- if (c != selmon->sel && !c->isurgent) +- seturgent(c, 1); ++ for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); ++ if (i < LENGTH(tags)) { ++ const Arg a = {.ui = 1 << i}; ++ selmon = c->mon; ++ view(&a); ++ focus(c); ++ restack(selmon); ++ } + } + } + +-- +2.17.1 + |
