diff --git a/README.md b/README.md index 60cad3f..592a5b2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: -2019-09-15 - Added xrdb, viewontag and winview patches +2019-09-15 - Added xrdb, viewontag, urgentborder and winview patches 2019-09-14 - Added setborderpx, selfrestart and push (no master variant), sticky and warp patches @@ -154,6 +154,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - [togglefullscreen](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff) - allows you to toggle fullscreen on and off using a single shortcut key + - [urgentborder](https://dwm.suckless.org/patches/urgentborder/) + - this patch makes "urgent" windows have different colors + - [vanitygaps](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-vanitygaps-6.2.diff) - adds configurable gaps between windows differentiating between outer, inner, horizontal and vertical gaps @@ -170,7 +173,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - [winview](http://dwm.suckless.org/patches/winview/) - allows switching the view to that of a given client from the all-window view (Mod-0) using a keyboard shortcut - - [xrdb](http://dwm.suckless.org/patches/xrdb/) + - [xrdb](http://dwm.suckless.org/patches/xrdb/f) - allows dwm to read colors from xrdb (.Xresources) during runtime - [zoomswap](https://dwm.suckless.org/patches/zoomswap/) diff --git a/config.def.h b/config.def.h index 55d20c1..ea2acb8 100644 --- a/config.def.h +++ b/config.def.h @@ -39,6 +39,15 @@ static char selbordercolor[] = "#005577"; static char selfloatcolor[] = "#005577"; #endif // FLOAT_BORDER_COLOR_PATCH +#if URGENTBORDER_PATCH +static char urgfgcolor[] = "#000000"; +static char urgbgcolor[] = "#000000"; +static char urgbordercolor[] = "#ff0000"; // NB: patch only works with border color for now +#if FLOAT_BORDER_COLOR_PATCH +static char urgfloatcolor[] = "#000000"; +#endif // FLOAT_BORDER_COLOR_PATCH +#endif // URGENTBORDER_PATCH + #if AWESOMEBAR_PATCH static char hidfgcolor[] = "#005577"; static char hidbgcolor[] = "#222222"; @@ -64,6 +73,9 @@ static const unsigned int alphas[][3] = { /* fg bg border */ [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, [SchemeSel] = { OPAQUE, baralpha, borderalpha }, + #if URGENTBORDER_PATCH + [SchemeUrg] = { OPAQUE, baralpha, borderalpha }, + #endif // URGENTBORDER_PATCH #if AWESOMEBAR_PATCH [SchemeHid] = { OPAQUE, baralpha, borderalpha }, #endif // AWESOMEBAR_PATCH @@ -81,6 +93,9 @@ char *colors[][4] = { /* fg bg border float */ [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor }, [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor }, + #if URGENTBORDER_PATCH + [SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor }, + #endif // URGENTBORDER_PATCH #if AWESOMEBAR_PATCH [SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidfloatcolor }, #endif // AWESOMEBAR_PATCH @@ -97,6 +112,9 @@ char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor }, [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, + #if URGENTBORDER_PATCH + [SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor }, + #endif // URGENTBORDER_PATCH #if AWESOMEBAR_PATCH [SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor }, #endif // AWESOMEBAR_PATCH diff --git a/dwm.c b/dwm.c index dff5555..0793985 100644 --- a/dwm.c +++ b/dwm.c @@ -77,6 +77,9 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ enum { SchemeNorm ,SchemeSel + #if URGENTBORDER_PATCH + ,SchemeUrg + #endif // URGENTBORDER_PATCH #if AWESOMEBAR_PATCH ,SchemeHid #endif // AWESOMEBAR_PATCH @@ -2909,8 +2912,19 @@ updatewmhints(Client *c) if (c == selmon->sel && wmh->flags & XUrgencyHint) { wmh->flags &= ~XUrgencyHint; XSetWMHints(dpy, c->win, wmh); - } else + } else { c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; + #if URGENTBORDER_PATCH + if (c->isurgent) { + #if FLOAT_BORDER_COLOR_PATCH + if (c->isfloating) + XSetWindowBorder(dpy, c->win, scheme[SchemeUrg][ColFloat].pixel); + else + #endif + XSetWindowBorder(dpy, c->win, scheme[SchemeUrg][ColBorder].pixel); + } + #endif // URGENTBORDER_PATCH + } if (wmh->flags & InputHint) c->neverfocus = !wmh->input; else diff --git a/patch/xrdb.c b/patch/xrdb.c index c5ffa76..cc3a2ba 100644 --- a/patch/xrdb.c +++ b/patch/xrdb.c @@ -30,6 +30,15 @@ loadxrdb() XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor); #endif // FLOAT_BORDER_COLOR_PATCH + #if URGENTBORDER_PATCH + XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor); + XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor); + XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor); + #if FLOAT_BORDER_COLOR_PATCH + XRDB_LOAD_COLOR("dwm.urgfloatcolor", urgfloatcolor); + #endif // FLOAT_BORDER_COLOR_PATCH + #endif // URGENTBORDER_PATCH + #if AWESOMEBAR_PATCH XRDB_LOAD_COLOR("dwm.hidfgcolor", hidfgcolor); XRDB_LOAD_COLOR("dwm.hidbgcolor", hidbgcolor); diff --git a/patches.h b/patches.h index 24e6846..5fa77b2 100644 --- a/patches.h +++ b/patches.h @@ -21,13 +21,13 @@ /* The alpha patch adds transparency for the status bar. * https://dwm.suckless.org/patches/alpha/ */ -#define ALPHA_PATCH 0 +#define ALPHA_PATCH 1 /* This patch introduces alternative tags which can be switched on the fly for the * sole purpose of providing visual aid. * https://dwm.suckless.org/patches/alternativetags/ */ -#define ALTERNATIVE_TAGS_PATCH 0 +#define ALTERNATIVE_TAGS_PATCH 1 /* This patch prevents the focus to drift from the active fullscreen client when * using focusstack(). @@ -46,7 +46,7 @@ * This patch takes precedence over ATTACHBELOW_PATCH. * https://dwm.suckless.org/patches/attachaside/ */ -#define ATTACHASIDE_PATCH 0 +#define ATTACHASIDE_PATCH 1 /* This patch adds new clients below the selected client. * This patch takes precedence over ATTACHBOTTOM_PATCH. @@ -65,57 +65,57 @@ * than the original ~/.dwm folder. * https://dwm.suckless.org/patches/autostart/ */ -#define AUTOSTART_PATCH 0 +#define AUTOSTART_PATCH 1 /* By default, windows that are not visible when requesting a resize/move will not * get resized/moved. With this patch, they will. * https://dwm.suckless.org/patches/autoresize/ */ -#define AUTORESIZE_PATCH 0 +#define AUTORESIZE_PATCH 1 /* Enhanced taskbar that shows the titles of all visible windows in the status bar * and allows focus / hiding / unhiding of windows by clicking on the status bar. * Awesomebar takes precedence over fancybar. * https://dwm.suckless.org/patches/awesomebar/ */ -#define AWESOMEBAR_PATCH 0 +#define AWESOMEBAR_PATCH 1 /* This patch adds an iscentered rule to automatically center clients on the current monitor. * This patch takes precedence over centeredwindowname and fancybar patches. * https://dwm.suckless.org/patches/center/ */ -#define CENTER_PATCH 0 +#define CENTER_PATCH 1 /* This patch centers the WM_NAME of the currently selected window on the status bar. * Both fancybar and awesomebar patches take precedence over this patch. * https://dwm.suckless.org/patches/centeredwindowname/ */ -#define CENTEREDWINDOWNAME_PATCH 0 +#define CENTEREDWINDOWNAME_PATCH 1 /* This patch provides the ability to assign different weights to clients in their * respective stack in tiled layout. * https://dwm.suckless.org/patches/cfacts/ */ -#define CFACTS_PATCH 0 +#define CFACTS_PATCH 1 /* This patch tweaks the tagging interface so that you can select multiple tags for tag * or view by pressing all the right keys as a combo. For example to view tags 1 and 3, * hold MOD and then press and hold 1 and 3 together. * https://dwm.suckless.org/patches/combo/ */ -#define COMBO_PATCH 0 +#define COMBO_PATCH 1 /* The cyclelayouts patch lets you cycle through all your layouts. * https://dwm.suckless.org/patches/cyclelayouts/ */ -#define CYCLELAYOUTS_PATCH 0 +#define CYCLELAYOUTS_PATCH 1 /* Adds EWMH support for _NET_NUMBER_OF_DESKTOPS, _NET_CURRENT_DESKTOP, _NET_DESKTOP_NAMES * and _NET_DESKTOP_VIEWPORT, which allows for compatibility with other bars and programs * that request workspace information. For example polybar's xworkspaces module. * https://dwm.suckless.org/patches/ewmhtags/ */ -#define EWMHTAGS_PATCH 0 +#define EWMHTAGS_PATCH 1 /* This patch shows the titles of all visible windows in the status bar * (as opposed to showing only the selected one). @@ -128,13 +128,13 @@ /* This patch allows a different border color to be chosen for floating windows. * https://dwm.suckless.org/patches/float_border_color/ */ -#define FLOAT_BORDER_COLOR_PATCH 0 +#define FLOAT_BORDER_COLOR_PATCH 1 /* By default, dwm responds to _NET_ACTIVE_WINDOW client messages by setting * the urgency bit on the named window. This patch activates the window instead. * https://dwm.suckless.org/patches/focusonnetactive/ */ -#define FOCUSONNETACTIVE_PATCH 0 +#define FOCUSONNETACTIVE_PATCH 1 /* By default in dwm it is possible to make an application fullscreen, then use * the focusstack keybindings to focus on other windows beneath the current window. @@ -143,7 +143,7 @@ * in such scenarios the previous window loses fullscreen. * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-losefullscreen-6.2.diff */ -#define LOSEFULLSCREEN_PATCH 0 +#define LOSEFULLSCREEN_PATCH 1 /* Adds rules per monitor, e.g. have default layouts per monitor. * The use case for this is if the second monitor is vertical (i.e. rotated) then @@ -151,23 +151,23 @@ * used for the main monitor. E.g. normal vertical split for main monitor and * horizontal split for the second. */ -#define MONITOR_RULES_PATCH 0 +#define MONITOR_RULES_PATCH 1 /* The pertag patch adds nmaster, mfacts and layouts per tag rather than per * monitor (default). * https://dwm.suckless.org/patches/pertag/ */ -#define PERTAG_PATCH 0 +#define PERTAG_PATCH 1 /* This controls whether or not to also store bar position on a per * tag basis, or leave it as one bar per monitor. */ -#define PERTAGBAR_PATCH 0 +#define PERTAGBAR_PATCH 1 /* This patch provides a way to move clients up and down inside the client list. * https://dwm.suckless.org/patches/push/ */ -#define PUSH_PATCH 0 +#define PUSH_PATCH 1 /* This patch provides a way to move clients up and down inside the client list, * but does not push up or down into the master area (except that it does not take @@ -181,44 +181,44 @@ * patch the mouse is warped to the nearest corner and you resize from there. * https://dwm.suckless.org/patches/resizecorners/ */ -#define RESIZECORNERS_PATCH 0 +#define RESIZECORNERS_PATCH 1 /* This patch let's you rotate through the stack using keyboard shortcuts. * https://dwm.suckless.org/patches/rotatestack/ */ -#define ROTATESTACK_PATCH 0 +#define ROTATESTACK_PATCH 1 /* This patch aves size and position of every floating window before it is forced * into tiled mode. If the window is made floating again then the old dimensions * will be restored. * https://dwm.suckless.org/patches/save_floats/ */ -#define SAVEFLOATS_PATCH 0 +#define SAVEFLOATS_PATCH 1 /* Allows restarting dwm without the dependency of an external script. * https://dwm.suckless.org/patches/selfrestart/ */ -#define SELFRESTART_PATCH 0 +#define SELFRESTART_PATCH 1 /* This patch allows border pixels to be changed during runtime. * https://dwm.suckless.org/patches/setborderpx/ */ -#define SETBORDERPX_PATCH 0 +#define SETBORDERPX_PATCH 1 /* This patch adds configuration options for horizontal and vertical padding in the status bar. * https://dwm.suckless.org/patches/statuspadding/ */ -#define STATUSPADDING_PATCH 0 +#define STATUSPADDING_PATCH 1 /* Adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags. * https://dwm.suckless.org/patches/sticky/ */ -#define STICKY_PATCH 0 +#define STICKY_PATCH 1 /* The systray patch adds systray for the status bar. * https://dwm.suckless.org/patches/systray/ */ -#define SYSTRAY_PATCH 0 +#define SYSTRAY_PATCH 1 /* By default dwm allow you to set application specific rules so that you can have your browser, * for example, start up on tag 9 optionally on a given monitor when you open your browser it is @@ -231,12 +231,12 @@ * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-switchtag-6.2.diff */ -#define SWITCHTAG_PATCH 0 +#define SWITCHTAG_PATCH 1 /* This patch allows you to move all visible windows on a monitor to an adjacent monitor. * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagallmon-6.2.diff */ -#define TAGALLMON_PATCH 0 +#define TAGALLMON_PATCH 1 /* If you try to send a fullscreen window to an adjacent monitor using tagmon then * the window is moved behind the scenes, but it remains in fullscreen on the original @@ -245,30 +245,35 @@ * while remaining in fullscreen. * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagmonfixfs-6.2.diff */ -#define TAGMONFIXFS_PATCH 0 +#define TAGMONFIXFS_PATCH 1 /* This patch allows you to swap all visible windows on one monitor with those of an * adjacent monitor. * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagswapmon-6.2.diff */ -#define TAGSWAPMON_PATCH 0 +#define TAGSWAPMON_PATCH 1 /* Adds a new color scheme used by the (selected) window title in the bar. * https://dwm.suckless.org/patches/titlecolor/ */ -#define TITLECOLOR_PATCH 0 +#define TITLECOLOR_PATCH 1 /* This patch allows you to toggle fullscreen on and off using a single shortcut key. * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff */ -#define TOGGLEFULLSCREEN_PATCH 0 +#define TOGGLEFULLSCREEN_PATCH 1 + +/* This patch makes "urgent" windows have different colors. + * https://dwm.suckless.org/patches/urgentborder/ + */ +#define URGENTBORDER_PATCH 1 /* This patch adds configurable gaps between windows differentiating between outer, inner, * horizontal and vertical gaps. * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-vanitygaps-6.2.diff * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-vanitygaps-cfacts-6.2.diff */ -#define VANITYGAPS_PATCH 0 +#define VANITYGAPS_PATCH 1 /* Follow a window to the tag it is being moved to. * https://dwm.suckless.org/patches/viewontag/ @@ -288,42 +293,42 @@ * or Google-chrome "browser" vs "pop-up". * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-windowrolerule-6.2.diff */ -#define WINDOWROLERULE_PATCH 0 +#define WINDOWROLERULE_PATCH 1 /* The winview patch allows switching the view to that of a given client from the all-window * view (Mod-0) using a keyboard shortcut. * http://dwm.suckless.org/patches/winview/ */ -#define WINVIEW_PATCH 0 +#define WINVIEW_PATCH 1 /* Allows dwm to read colors from xrdb (.Xresources) during runtime. Compatible with - * the float border color, awesomebar and titlecolor patches. + * the float border color, awesomebar, urgentborder and titlecolor patches. * https://dwm.suckless.org/patches/xrdb/ */ -#define XRDB_PATCH 0 +#define XRDB_PATCH 1 /* The zoomswap patch allows a master and a stack window to swap places * rather than every window on the screen changing position. * https://dwm.suckless.org/patches/zoomswap/ */ -#define ZOOMSWAP_PATCH 0 +#define ZOOMSWAP_PATCH 1 /* Layouts */ /* Bottomstack layout. * https://dwm.suckless.org/patches/bottomstack/ */ -#define BSTACK_LAYOUT 0 +#define BSTACK_LAYOUT 1 /* Bottomstack horizontal layout. * https://dwm.suckless.org/patches/bottomstack/ */ -#define BSTACKHORIZ_LAYOUT 0 +#define BSTACKHORIZ_LAYOUT 1 /* Centered master layout. * https://dwm.suckless.org/patches/centeredmaster/ */ -#define CENTEREDMASTER_LAYOUT 0 +#define CENTEREDMASTER_LAYOUT 1 /* Centered floating master layout. * https://dwm.suckless.org/patches/centeredmaster/ @@ -333,7 +338,7 @@ /* Deck layout. * https://dwm.suckless.org/patches/deck/ */ -#define DECK_LAYOUT 0 +#define DECK_LAYOUT 1 /* Fibonacci dwindle layout. * https://dwm.suckless.org/patches/fibonacci/ @@ -348,7 +353,7 @@ /* Flextile layout. * https://dwm.suckless.org/patches/flextile/ */ -#define FLEXTILE_LAYOUT 0 +#define FLEXTILE_LAYOUT 1 /* Gappless grid layout. * https://dwm.suckless.org/patches/gaplessgrid/ @@ -373,9 +378,9 @@ /* The default tile layout. * This can be optionally disabled in favour of other layouts. */ -#define TILE_LAYOUT 1 +#define TILE_LAYOUT 0 /* Monocle layout (default). * This can be optionally disabled in favour of other layouts. */ -#define MONOCLE_LAYOUT 1 +#define MONOCLE_LAYOUT 0