diff options
| author | bakkeby <[email protected]> | 2019-10-03 00:10:08 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2019-10-03 00:10:08 +0200 |
| commit | 9ebd9c8397c395d1ec8daf27723a70c901315bb3 (patch) | |
| tree | 9d1f4d861d0f319243f33fe892d4b3407666ecf3 | |
| parent | 1f21ed72d14af33fb490c14fcf809fe0606fadb0 (diff) | |
| download | dwm-flexipatch-9ebd9c8397c395d1ec8daf27723a70c901315bb3.tar.gz dwm-flexipatch-9ebd9c8397c395d1ec8daf27723a70c901315bb3.zip | |
Adding focusurgent patch
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | config.def.h | 3 | ||||
| -rw-r--r-- | patch/focusurgent.c | 15 | ||||
| -rw-r--r-- | patch/focusurgent.h | 1 | ||||
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 | ||||
| -rw-r--r-- | patches.h | 9 |
7 files changed, 39 insertions, 2 deletions
@@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: -2019-10-02 - Added restartsig, emptyview and focusadjacenttag patches +2019-10-02 - Added restartsig, emptyview, focusurgent and focusadjacenttag patches 2019-10-01 - Added leftlayout, fullscreen, holdbar and unfloatvisible patches @@ -112,6 +112,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - by default, dwm responds to \_NET_ACTIVE_WINDOW client messages by setting the urgency bit on the named window - this patch activates the window instead + - [focusurgent](https://dwm.suckless.org/patches/focusurgent/) + - adds a keyboard shortcut to select the next window having the urgent flag regardless of the tag it is on + - [fullscreen](https://dwm.suckless.org/patches/fullscreen/) - applies the monocle layout with the focused client on top and hides the bar - when pressed again it shows the bar and restores the layout that was active before going fullscreen diff --git a/config.def.h b/config.def.h index 4459f49..857acc2 100644 --- a/config.def.h +++ b/config.def.h @@ -361,6 +361,9 @@ static Key keys[] = { #if RESTARTSIG_PATCH { MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} }, #endif // RESTARTSIG_PATCH + #if FOCUSURGENT_PATCH + { MODKEY, XK_u, focusurgent, {0} }, + #endif // FOCUSURGENT_PATCH #if HOLDBAR_PATCH { 0, HOLDKEY, holdbar, {0} }, #endif // HOLDBAR_PATCH diff --git a/patch/focusurgent.c b/patch/focusurgent.c new file mode 100644 index 0000000..67d71bc --- /dev/null +++ b/patch/focusurgent.c @@ -0,0 +1,15 @@ +void +focusurgent(const Arg *arg) +{ + Client *c; + int i; + for (c=selmon->clients; c && !c->isurgent; c=c->next); + if (c) { + for (i=0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); + if (i < LENGTH(tags)) { + const Arg a = {.ui = 1 << i}; + view(&a); + focus(c); + } + } +}
\ No newline at end of file diff --git a/patch/focusurgent.h b/patch/focusurgent.h new file mode 100644 index 0000000..27ab8ac --- /dev/null +++ b/patch/focusurgent.h @@ -0,0 +1 @@ +static void focusurgent(const Arg *arg);
\ No newline at end of file diff --git a/patch/include.c b/patch/include.c index 82b151b..cd52548 100644 --- a/patch/include.c +++ b/patch/include.c @@ -40,6 +40,10 @@ #include "focusadjacenttag.c" #endif +#if FOCUSURGENT_PATCH +#include "focusurgent.c" +#endif + #if FULLSCREEN_PATCH #include "fullscreen.c" #endif diff --git a/patch/include.h b/patch/include.h index 74b5404..ca2940a 100644 --- a/patch/include.h +++ b/patch/include.h @@ -40,6 +40,10 @@ #include "focusadjacenttag.h" #endif +#if FOCUSURGENT_PATCH +#include "focusurgent.h" +#endif + #if FULLSCREEN_PATCH #include "fullscreen.h" #endif @@ -137,13 +137,20 @@ * the right tag. * http://dwm.suckless.org/patches/focusadjacenttag/ */ -#define FOCUSADJACENTTAG_PATCH 1 +#define FOCUSADJACENTTAG_PATCH 0 /* Switch focus only by mouse click and not sloppy (focus follows mouse pointer). * https://dwm.suckless.org/patches/focusonclick/ */ #define FOCUSONCLICK_PATCH 0 +/* Selects the next window having the urgent flag regardless of the tag it is on. + * The urgent flag can be artificially set with the following xdotool command on any window: + * xdotool selectwindow -- set_window --urgency 1 + * https://dwm.suckless.org/patches/focusurgent/ + */ +#define FOCUSURGENT_PATCH 0 + /* This patch allows a different border color to be chosen for floating windows. * https://dwm.suckless.org/patches/float_border_color/ */ |
