mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding focusurgent patch
This commit is contained in:
parent
1f21ed72d1
commit
9ebd9c8397
@ -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
|
||||
|
@ -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
|
||||
|
15
patch/focusurgent.c
Normal file
15
patch/focusurgent.c
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
1
patch/focusurgent.h
Normal file
1
patch/focusurgent.h
Normal file
@ -0,0 +1 @@
|
||||
static void focusurgent(const Arg *arg);
|
@ -40,6 +40,10 @@
|
||||
#include "focusadjacenttag.c"
|
||||
#endif
|
||||
|
||||
#if FOCUSURGENT_PATCH
|
||||
#include "focusurgent.c"
|
||||
#endif
|
||||
|
||||
#if FULLSCREEN_PATCH
|
||||
#include "fullscreen.c"
|
||||
#endif
|
||||
|
@ -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/
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user