[wiki] [sites] dwm: update urgent border patch || Alexander Huemer
commit 859da9e8adead6332b1f641beaee31421943d0be
Author: Alexander Huemer <alexander.huemer_AT_xx.vu>
Date: Sat Mar 7 22:03:30 2015 +0100
dwm: update urgent border patch
diff --git a/dwm.suckless.org/patches/dwm-5.7.2-urgentborder.diff b/dwm.suckless.org/patches/dwm-5.7.2-urgentborder.diff
deleted file mode 100644
index c5d86fc..0000000
--- a/dwm.suckless.org/patches/dwm-5.7.2-urgentborder.diff
+++ /dev/null
_AT_@ -1,45 +0,0 @@
-diff -r 7b02d596fa11 config.def.h
---- a/config.def.h Mon Dec 21 01:16:59 2009 -0500
-+++ b/config.def.h Mon Dec 21 01:18:51 2009 -0500
-_AT_@ -8,6 +8,7 @@
- static const char selbordercolor[] = "#0066ff";
- static const char selbgcolor[] = "#0066ff";
- static const char selfgcolor[] = "#ffffff";
-+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 -r 7b02d596fa11 dwm.c
---- a/dwm.c Mon Dec 21 01:16:59 2009 -0500
-+++ b/dwm.c Mon Dec 21 01:18:51 2009 -0500
-_AT_@ -97,6 +97,7 @@
- int x, y, w, h;
- unsigned long norm[ColLast];
- unsigned long sel[ColLast];
-+ unsigned long urg[ColLast];
- Drawable drawable;
- GC gc;
- struct {
-_AT_@ -1504,6 +1505,9 @@
- dc.sel[ColBorder] = getcolor(selbordercolor);
- dc.sel[ColBG] = getcolor(selbgcolor);
- dc.sel[ColFG] = getcolor(selfgcolor);
-+ dc.urg[ColBorder] = getcolor(urgbordercolor);
-+ dc.urg[ColBG] = getcolor(selbgcolor);
-+ dc.urg[ColFG] = getcolor(selfgcolor);
- dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
- dc.gc = XCreateGC(dpy, root, 0, NULL);
- XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
-_AT_@ -1904,8 +1908,11 @@
- wmh->flags &= ~XUrgencyHint;
- XSetWMHints(dpy, c->win, wmh);
- }
-- else
-+ else {
- c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
-+ if (c->isurgent)
-+ XSetWindowBorder(dpy, c->win, dc.urg[ColBorder]);
-+ }
- XFree(wmh);
- }
- }
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
new file mode 100644
index 0000000..bc06d08
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-make-the-borders-of-urgent-windows-a-different-color.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->rgb);
++ }
+ 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 ba0aee4..0756a24 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-5.7.2-urgentborder.diff](dwm-5.7.2-urgentborder.diff) (1.6K) (20091221)
+ * [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)
## Author
- * Ray Kohler - ataraxia937 gmail com
+ * Alexander Huemer - alexander dot huemer dot xx dot vu (Based on former work by Ray Kohler - ataraxia937 gmail com)
Received on Sat Mar 07 2015 - 22:04:15 CET
This archive was generated by hypermail 2.3.0
: Thu Jun 18 2015 - 17:40:14 CEST