[wiki] [sites] [dwm][urg-border] Shorten patch || Ivan Tham

From: <git_AT_suckless.org>
Date: Sun, 27 Sep 2015 06:18:20 +0200

commit 440a4253755e70ff43c4672caa728b35ae54062e
Author: Ivan Tham <pickfire_AT_riseup.net>
Date: Sun Sep 27 12:18:16 2015 +0800

    [dwm][urg-border] Shorten patch

diff --git a/dwm.suckless.org/patches/dwm-6.1-make-the-borders-of-urgent-windows-a-different-color.diff b/dwm.suckless.org/patches/dwm-6.1-make-the-borders-of-urgent-windows-a-different-color.diff
deleted file mode 100644
index bc06d08..0000000
--- a/dwm.suckless.org/patches/dwm-6.1-make-the-borders-of-urgent-windows-a-different-color.diff
+++ /dev/null
_AT_@ -1,61 +0,0 @@
-From 8b7bc42822cd5924450bbfc9ed598f72254473ba Mon Sep 17 00:00:00 2001
-From: Alexander Huemer <alexander.huemer_AT_xx.vu>
-Date: Sat, 7 Mar 2015 21:45:48 +0100
-Subject: [PATCH] Make the borders of urgent windows a different color
-
----
- config.def.h |  1 +
- dwm.c        | 10 ++++++++--
- 2 files changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/config.def.h b/config.def.h
-index 875885b..5276f02 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -8,6 +8,7 @@ static const char normfgcolor[]     = "#bbbbbb";
- static const char selbordercolor[]  = "#005577";
- static const char selbgcolor[]      = "#005577";
- static const char selfgcolor[]      = "#eeeeee";
-+static const char urgbordercolor[]  = "#ff0000";
- static const unsigned int borderpx  = 1;        /* border pixel of windows */
- static const unsigned int snap      = 32;       /* snap pixel */
- static const Bool showbar           = True;     /* False means no bar */
-diff --git a/dwm.c b/dwm.c
-index c8fc7d7..0924ace 100644
---- a/dwm.c
-+++ b/dwm.c
-_AT_@ -58,7 +58,7 @@
- 
- /* enums */
- enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
--enum { SchemeNorm, SchemeSel, SchemeLast }; /* color schemes */
-+enum { SchemeNorm, SchemeSel, SchemeUrg, SchemeLast }; /* color schemes */
- enum { NetSupported, NetWMName, NetWMState,
-        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
-        NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
-_AT_@ -1537,6 +1537,9 @@ setup(void) {
- 	scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor);
- 	scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor);
- 	scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor);
-+	scheme[SchemeUrg].border = drw_clr_create(drw, urgbordercolor);
-+	scheme[SchemeUrg].bg = drw_clr_create(drw, selbgcolor);
-+	scheme[SchemeUrg].fg = drw_clr_create(drw, selfgcolor);
- 	/* init bars */
- 	updatebars();
- 	updatestatus();
-_AT_@ -1982,8 +1985,11 @@ updatewmhints(Client *c) {
- 			wmh->flags &= ~XUrgencyHint;
- 			XSetWMHints(dpy, c->win, wmh);
- 		}
--		else
-+		else {
- 			c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
-+			if (c->isurgent)
-+				XSetWindowBorder(dpy, c->win, scheme[SchemeUrg].border->rgb);
-+		}
- 		if(wmh->flags & InputHint)
- 			c->neverfocus = !wmh->input;
- 		else
--- 
-2.1.4
-
diff --git a/dwm.suckless.org/patches/dwm-6.1-urg-border.diff b/dwm.suckless.org/patches/dwm-6.1-urg-border.diff
new file mode 100644
index 0000000..c1ed034
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-urg-border.diff
_AT_@ -0,0 +1,61 @@
+From 8b7bc42822cd5924450bbfc9ed598f72254473ba Mon Sep 17 00:00:00 2001
+From: Alexander Huemer <alexander.huemer_AT_xx.vu>
+Date: Sat, 7 Mar 2015 21:45:48 +0100
+Subject: [PATCH] Make the borders of urgent windows a different color
+
+---
+ config.def.h |  1 +
+ dwm.c        | 10 ++++++++--
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 875885b..5276f02 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -8,6 +8,7 @@ static const char normfgcolor[]     = "#bbbbbb";
+ static const char selbordercolor[]  = "#005577";
+ static const char selbgcolor[]      = "#005577";
+ static const char selfgcolor[]      = "#eeeeee";
++static const char urgbordercolor[]  = "#ff0000";
+ static const unsigned int borderpx  = 1;        /* border pixel of windows */
+ static const unsigned int snap      = 32;       /* snap pixel */
+ static const Bool showbar           = True;     /* False means no bar */
+diff --git a/dwm.c b/dwm.c
+index c8fc7d7..0924ace 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -58,7 +58,7 @@
+ 
+ /* enums */
+ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
+-enum { SchemeNorm, SchemeSel, SchemeLast }; /* color schemes */
++enum { SchemeNorm, SchemeSel, SchemeUrg, SchemeLast }; /* color schemes */
+ enum { NetSupported, NetWMName, NetWMState,
+        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
+        NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
+_AT_@ -1537,6 +1537,9 @@ setup(void) {
+ 	scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor);
+ 	scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor);
+ 	scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor);
++	scheme[SchemeUrg].border = drw_clr_create(drw, urgbordercolor);
++	scheme[SchemeUrg].bg = drw_clr_create(drw, selbgcolor);
++	scheme[SchemeUrg].fg = drw_clr_create(drw, selfgcolor);
+ 	/* init bars */
+ 	updatebars();
+ 	updatestatus();
+_AT_@ -1982,8 +1985,11 @@ updatewmhints(Client *c) {
+ 			wmh->flags &= ~XUrgencyHint;
+ 			XSetWMHints(dpy, c->win, wmh);
+ 		}
+-		else
++		else {
+ 			c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
++			if (c->isurgent)
++				XSetWindowBorder(dpy, c->win, scheme[SchemeUrg].border->pix);
++		}
+ 		if(wmh->flags & InputHint)
+ 			c->neverfocus = !wmh->input;
+ 		else
+-- 
+2.1.4
+
diff --git a/dwm.suckless.org/patches/urgentborder.md b/dwm.suckless.org/patches/urgentborder.md
index 0756a24..746b590 100644
--- a/dwm.suckless.org/patches/urgentborder.md
+++ b/dwm.suckless.org/patches/urgentborder.md
_AT_@ -8,8 +8,8 @@ Use config.h item "urgbordercolor" to change it.
 
 ## Download
 
- * [dwm-6.1-make-the-borders-of-urgent-windows-a-different-color.diff](dwm-6.1-make-the-borders-of-urgent-windows-a-different-color.diff) (2.2K) (20150307)
-
+ * [dwm-6.1-urg-border.diff](dwm-6.1-urg-border.diff) (2.2K) (20150307)
+ 
 ## Author
 
  * Alexander Huemer - alexander dot huemer dot xx dot vu (Based on former work by Ray Kohler - ataraxia937 gmail com)
Received on Sun Sep 27 2015 - 06:18:20 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 27 2015 - 06:24:11 CEST