From 41259cc53bb01ca01564321894ffa027c1fd2928 Mon Sep 17 00:00:00 2001 From: dianshi Date: Sun, 5 Apr 2020 14:49:13 +0100 Subject: Added urgent notification coloring --- Kconfig | 4 ++++ config.h | 5 +++++ dwm.c | 13 +++++++++++++ kconfig.h | 1 + 4 files changed, 23 insertions(+) diff --git a/Kconfig b/Kconfig index 5e643a2..c1a3034 100644 --- a/Kconfig +++ b/Kconfig @@ -7,3 +7,7 @@ config DWM_PERTAG config DWM_ALTERNATIVETAGS bool "Alternative names for tags" default n + +config DWM_URGBORDER + bool "Change urgent message color" + default n \ No newline at end of file diff --git a/config.h b/config.h index 5398aec..55eb463 100644 --- a/config.h +++ b/config.h @@ -12,10 +12,15 @@ 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_red1[] = "#ff0000"; + static const char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, [SchemeSel] = { col_gray4, col_cyan, col_cyan }, +#ifdef CONFIG_DWM_URGBORDER + [SchemeUrg] = { col_red1, col_red1, col_red1 }, +#endif }; /* tagging */ diff --git a/dwm.c b/dwm.c index 2ce630f..0a1e33e 100644 --- a/dwm.c +++ b/dwm.c @@ -61,7 +61,11 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ +#ifdef CONFIG_DWM_URGBORDER +enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */ +#else enum { SchemeNorm, SchemeSel }; /* color schemes */ +#endif enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ @@ -2179,6 +2183,15 @@ updatewmhints(Client *c) XSetWMHints(dpy, c->win, wmh); } else c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; + /******************************************************************/ + #ifdef CONFIG_DWM_URGBORDER + if (c->isurgent) + { + //XSetWindowBorder(dpy, c->win, scheme[SchemeUrg].border->pix); + XSetWindowBorder(dpy, c->win, scheme[SchemeUrg][ColBorder].pixel); + } + #endif + /******************************************************************/ if (wmh->flags & InputHint) c->neverfocus = !wmh->input; else diff --git a/kconfig.h b/kconfig.h index 4d487fc..560e218 100644 --- a/kconfig.h +++ b/kconfig.h @@ -4,4 +4,5 @@ #define CONFIG_DEBUG_PRINT_DEBUG #define CONFIG_DWM_PERTAG #define CONFIG_DWM_ALTERNATIVETAGS +#define CONFIG_DWM_URGBORDER #endif -- cgit v1.2.3