about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-08-06 09:39:15 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-08-06 09:39:15 +0200
commita314ffca1d3307d5ddcb02bce0c235307e417267 (patch)
treec7722c6cf1a96f8145e61973656af54607057302
parentChanged button functionality clicking on layout symbol so that it cycles trough (diff)
downloaddwm-a314ffca1d3307d5ddcb02bce0c235307e417267.tar.gz
dwm-a314ffca1d3307d5ddcb02bce0c235307e417267.tar.bz2
dwm-a314ffca1d3307d5ddcb02bce0c235307e417267.zip
Added urgentborder patch
-rw-r--r--config.h5
-rw-r--r--dwm.c6
-rw-r--r--patches/dwm-urgentborder-6.2.diff57
3 files changed, 65 insertions, 3 deletions
diff --git a/config.h b/config.h
index 993d20f..a501793 100644
--- a/config.h
+++ b/config.h
@@ -14,6 +14,8 @@ static const char col_gray2[]       = "#444444";
 static const char col_gray3[]       = "#bbbbbb";
 static const char col_gray4[]       = "#eeeeee";
 static const char col_cyan[]        = "#005577";
+static const char col_red[]         = "#ff0000";
+
 
 static const unsigned int baralpha = OPAQUE; //0xd0 is transparent
 static const unsigned int borderalpha = OPAQUE;
@@ -22,6 +24,7 @@ static const char *colors[][3]      = {
 	/*               fg         bg         border   */
 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
 	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
+	[SchemeUrg]  = { col_gray4, col_cyan,  col_red   },
 	[SchemeTitle]= { col_gray3, col_gray1, col_gray2 },
 
 };
@@ -29,6 +32,7 @@ static const unsigned int alphas[][3]      = {
 	/*               fg      bg        border     */
 	[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
 	[SchemeSel]  = { OPAQUE, baralpha, borderalpha },
+	[SchemeUrg]  = { OPAQUE, baralpha, borderalpha },
 	[SchemeTitle]= { OPAQUE, baralpha, borderalpha },
 };
 
@@ -118,6 +122,7 @@ static Key keys[] = {
 	TAGKEYS(                        XK_8,                      7)
 	TAGKEYS(                        XK_9,                      8)
 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
+
 };
 
 /* button definitions */
diff --git a/dwm.c b/dwm.c
index 501661f..2d10692 100644
--- a/dwm.c
+++ b/dwm.c
@@ -61,7 +61,7 @@
 
 /* enums */
 enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-enum { SchemeNorm, SchemeSel, SchemeTitle }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeUrg, SchemeTitle }; /* color schemes */
 enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
        NetWMWindowTypeDialog, NetClientList, NetDesktopNames, NetDesktopViewport, NetNumberOfDesktops, NetCurrentDesktop, NetLast }; /* EWMH atoms */
@@ -2096,8 +2096,8 @@ updatewmhints(Client *c)
 		if (c == selmon->sel && wmh->flags & XUrgencyHint) {
 			wmh->flags &= ~XUrgencyHint;
 			XSetWMHints(dpy, c->win, wmh);
-		} else
-			c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0;
+    } else if ((c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0))
+      XSetWindowBorder(dpy, c->win, scheme[SchemeUrg][ColBorder].pixel);
 		if (wmh->flags & InputHint)
 			c->neverfocus = !wmh->input;
 		else
diff --git a/patches/dwm-urgentborder-6.2.diff b/patches/dwm-urgentborder-6.2.diff
new file mode 100644
index 0000000..f5cd981
--- /dev/null
+++ b/patches/dwm-urgentborder-6.2.diff
@@ -0,0 +1,57 @@
+From b70614f535764227245fb19d2f7f0e1174911175 Mon Sep 17 00:00:00 2001
+From: Larry <fake_larry@protonmail.com>
+Date: Mon, 5 Aug 2019 21:32:48 +0000
+Subject: [PATCH] Update urgentborder to 6.2
+
+Description from the original author:
+
+This patch makes borders of "urgent" windows a different color. By
+default it is bright red. Use config.h item "urgbordercolor" to change
+it.
+
+Author:
+Alexander Huemer - alexander dot huemer dot xx dot vu (Based on former
+work by Ray Kohler - ataraxia937 gmail com)
+---
+ config.def.h | 1 +
+ dwm.c        | 6 +++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..6832fec 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -16,6 +16,7 @@ static const char *colors[][3]      = {
+ 	/*               fg         bg         border   */
+ 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
+ 	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
++	[SchemeUrg]  = { col_gray4, col_cyan,  "#ff0000" },
+ };
+ 
+ /* tagging */
+diff --git a/dwm.c b/dwm.c
+index 4465af1..49ee757 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -59,7 +59,7 @@
+ 
+ /* enums */
+ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
+-enum { SchemeNorm, SchemeSel }; /* color schemes */
++enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */
+ enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
+        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
+        NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
+@@ -2022,8 +2022,8 @@ updatewmhints(Client *c)
+ 		if (c == selmon->sel && wmh->flags & XUrgencyHint) {
+ 			wmh->flags &= ~XUrgencyHint;
+ 			XSetWMHints(dpy, c->win, wmh);
+-		} else
+-			c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0;
++		} else if ((c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0))
++			XSetWindowBorder(dpy, c->win, scheme[SchemeUrg][ColBorder].pixel);
+ 		if (wmh->flags & InputHint)
+ 			c->neverfocus = !wmh->input;
+ 		else
+-- 
+2.21.0