dwm-6.1-urg-border.diff (2252B)
1 From 8b7bc42822cd5924450bbfc9ed598f72254473ba Mon Sep 17 00:00:00 2001 2 From: Alexander Huemer <alexander.huemer@xx.vu> 3 Date: Sat, 7 Mar 2015 21:45:48 +0100 4 Subject: [PATCH] Make the borders of urgent windows a different color 5 6 --- 7 config.def.h | 1 + 8 dwm.c | 10 ++++++++-- 9 2 files changed, 9 insertions(+), 2 deletions(-) 10 11 diff --git a/config.def.h b/config.def.h 12 index 875885b..5276f02 100644 13 --- a/config.def.h 14 +++ b/config.def.h 15 @@ -8,6 +8,7 @@ static const char normfgcolor[] = "#bbbbbb"; 16 static const char selbordercolor[] = "#005577"; 17 static const char selbgcolor[] = "#005577"; 18 static const char selfgcolor[] = "#eeeeee"; 19 +static const char urgbordercolor[] = "#ff0000"; 20 static const unsigned int borderpx = 1; /* border pixel of windows */ 21 static const unsigned int snap = 32; /* snap pixel */ 22 static const Bool showbar = True; /* False means no bar */ 23 diff --git a/dwm.c b/dwm.c 24 index c8fc7d7..0924ace 100644 25 --- a/dwm.c 26 +++ b/dwm.c 27 @@ -58,7 +58,7 @@ 28 29 /* enums */ 30 enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 31 -enum { SchemeNorm, SchemeSel, SchemeLast }; /* color schemes */ 32 +enum { SchemeNorm, SchemeSel, SchemeUrg, SchemeLast }; /* color schemes */ 33 enum { NetSupported, NetWMName, NetWMState, 34 NetWMFullscreen, NetActiveWindow, NetWMWindowType, 35 NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 36 @@ -1537,6 +1537,9 @@ setup(void) { 37 scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor); 38 scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor); 39 scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor); 40 + scheme[SchemeUrg].border = drw_clr_create(drw, urgbordercolor); 41 + scheme[SchemeUrg].bg = drw_clr_create(drw, selbgcolor); 42 + scheme[SchemeUrg].fg = drw_clr_create(drw, selfgcolor); 43 /* init bars */ 44 updatebars(); 45 updatestatus(); 46 @@ -1982,8 +1985,11 @@ updatewmhints(Client *c) { 47 wmh->flags &= ~XUrgencyHint; 48 XSetWMHints(dpy, c->win, wmh); 49 } 50 - else 51 + else { 52 c->isurgent = (wmh->flags & XUrgencyHint) ? True : False; 53 + if (c->isurgent) 54 + XSetWindowBorder(dpy, c->win, scheme[SchemeUrg].border->pix); 55 + } 56 if(wmh->flags & InputHint) 57 c->neverfocus = !wmh->input; 58 else 59 -- 60 2.1.4 61