Adding bar modules which splits the dwm bar into modules allowing for re-arrangement of the bar and easier integration for new features

pull/48/head
bakkeby 4 years ago
commit a7d1663571

@ -2,7 +2,7 @@ This dwm 6.2 (aaad5f, 2020-07-08) side project has a different take on dwm patch
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h):
```c
#define ALPHA_PATCH 1
#define BAR_ALPHA_PATCH 1
```
So if you have ever been curious about trying out dwm, but have been discouraged by manual patching, then this may be a good starting point to see what a "fully fledged" dwm can look like. Want to try out the `pertag` patch? Just flip a config and recompile. Once you have found out what works for you and what doesn't then you should be in a better position to choose patches should you want to start patching from scratch.
@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
2020-07-19 - Added bar_modules patch - making extrabar, leftlayout, staticstatus and statusallmons patches redundant
2020-07-18 - **Note**: Up until now building dwm-flexipath without any patches selected would have given you something more or less identical with mainstream dwm. In order to reduce complexity when it comes to maintainance future versions of dwm-flexipatch may diverge from this by making some patches non-optional. For the classic dwm-flexipatch and its many patch integration hints refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0) which will be subject to bug fixes and mainstream dwm updates as far as feasible.
2020-07-05 - Extrabar compatibility improvements (staticstatus, status2d, dwmblocks) and fix for systray randomly causing dwm to crash when first systray application starts
@ -173,6 +175,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [bar_height](https://dwm.suckless.org/patches/bar_height/)
- allows the bar height to be explicitly set rather than being derived from font
- bar_modules
- splits the dwm bar into modules allowing for re-arrangement of the bar and easier integration for new features
- [barpadding](https://dwm.suckless.org/patches/barpadding/)
- adds vertical and horizontal space between the statusbar and the edge of the screen
@ -224,9 +229,12 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- this patch allows the user to change size and placement of floating windows using only the keyboard
- it also allows for temporary vertical and horizontal extension of windows similar to other WMs fill command
- [extrabar](https://dwm.suckless.org/patches/extrabar/)
- enables an extra status bar in dwm in a similar manner to the dualstatus patch
- if the primary status is at the top via topbar then the extra status bar will be placed at the bottom and vice versa
- [-extrabar-](https://dwm.suckless.org/patches/extrabar/)
- -enables an extra status bar in dwm in a similar manner to the dualstatus patch-
- -if the primary status is at the top via topbar then the extra status bar will be placed at the bottom and vice versa-
- extrastatus
- formerly extrabar - now only splits the status into to statuses by using a status separator
- [fakefullscreen](https://dwm.suckless.org/patches/fakefullscreen/)
- only allow clients to "fullscreen" into the space currently given to them
@ -291,8 +299,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [keymodes](https://dwm.suckless.org/patches/keymodes/)
- this patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts can be performed
- [leftlayout](http://dwm.suckless.org/patches/leftlayout/)
- moves the layout symbol in the status bar to the left hand side
- [-leftlayout-](http://dwm.suckless.org/patches/leftlayout/)
- -moves the layout symbol in the status bar to the left hand side-
- [losefullscreen](https://github.com/bakkeby/patches/tree/master/dwm/dwm-losefullscreen-6.2.diff)
- 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
@ -398,14 +406,14 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [stacker](https://dwm.suckless.org/patches/stacker/)
- provides comprehensive utilities for managing the client stack
- [staticstatus](https://dwm.suckless.org/patches/staticstatus/)
- allows the status text to be fixed to the bar on a specific monitor rather than being drawn on the focused monitor
- [-staticstatus-](https://dwm.suckless.org/patches/staticstatus/)
- -allows the status text to be fixed to the bar on a specific monitor rather than being drawn on the focused monitor-
- [status2d](https://dwm.suckless.org/patches/status2d/)
- allows colors and rectangle drawing in the dwm status bar
- [statusallmons](https://dwm.suckless.org/patches/statuspadding/)
- this patch draws and updates the statusbar on all monitors
- [-statusallmons-](https://dwm.suckless.org/patches/statuspadding/)
- -this patch draws and updates the statusbar on all monitors-
- [statusbutton](https://dwm.suckless.org/patches/statusbutton/)
- adds a clickable button to the left hand side of the statusbar

@ -15,19 +15,19 @@ static const unsigned int gappoh = 10; /* horiz outer gap between windo
static const unsigned int gappov = 30; /* vert outer gap between windows and screen edge */
static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */
#endif // VANITYGAPS_PATCH
#if HOLDBAR_PATCH
#if BAR_HOLDBAR_PATCH
static const int showbar = 0; /* 0 means no bar */
#else
static const int showbar = 1; /* 0 means no bar */
#endif // HOLDBAR_PATCH
#endif // BAR_HOLDBAR_PATCH
static const int topbar = 1; /* 0 means bottom bar */
#if BAR_HEIGHT_PATCH
static const int bar_height = 0; /* 0 means derive from font, >= 1 explicit height */
#endif // BAR_HEIGHT_PATCH
#if BARPADDING_PATCH
#if BAR_PADDING_PATCH
static const int vertpad = 10; /* vertical padding of bar */
static const int sidepad = 10; /* horizontal padding of bar */
#endif // BARPADDING_PATCH
#endif // BAR_PADDING_PATCH
#if FOCUSONCLICK_PATCH
static const int focusonwheel = 0;
#endif // FOCUSONCLICK_PATCH
@ -35,136 +35,127 @@ static const int focusonwheel = 0;
static int floatposgrid_x = 5; /* float grid columns */
static int floatposgrid_y = 5; /* float grid rows */
#endif // FLOATPOS_PATCH
#if STATUSPADDING_PATCH
#if BAR_STATUSPADDING_PATCH
static const int horizpadbar = 2; /* horizontal padding for statusbar */
static const int vertpadbar = 0; /* vertical padding for statusbar */
#endif // STATUSPADDING_PATCH
#if STATICSTATUS_PATCH && !STATUSALLMONS_PATCH
static const int statmonval = 0;
#endif // STATICSTATUS_PATCH
#if STATUSBUTTON_PATCH
#endif // BAR_STATUSPADDING_PATCH
#if BAR_STATUSBUTTON_PATCH
static const char buttonbar[] = "<O>";
#endif // STATUSBUTTON_PATCH
#if SYSTRAY_PATCH
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
#endif // BAR_STATUSBUTTON_PATCH
#if BAR_SYSTRAY_PATCH
static const unsigned int systrayspacing = 2; /* systray spacing */
static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
static const int showsystray = 1; /* 0 means no systray */
#endif // SYSTRAY_PATCH
#endif // BAR_SYSTRAY_PATCH
#if ONLYQUITONEMPTY_PATCH
static const int quit_empty_window_count = 2; /* only allow dwm to quit if no windows are open, value here represents number of deamons */
#endif // ONLYQUITONEMPTY_PATCH
#if EXTRABAR_PATCH
#if BAR_EXTRASTATUS_PATCH
static const char statussep = ';'; /* separator between status bars */
static const int ebalign = 0; /* extrabar alignment: 0 - left, 1 - right, 2 - center */
#if STATICSTATUS_PATCH && !STATUSALLMONS_PATCH
static const int statebmonval = statmonval;
#endif // STATICSTATUS_PATCH
#endif // EXTRABAR_PATCH
#if PANGO_PATCH
#endif // BAR_EXTRASTATUS_PATCH
#if BAR_PANGO_PATCH
static const char font[] = "monospace 10";
#else
static const char *fonts[] = { "monospace:size=10" };
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
static const char dmenufont[] = "monospace:size=10";
static char normfgcolor[] = "#bbbbbb";
static char normbgcolor[] = "#222222";
#if !VTCOLORS_PATCH
#if !BAR_VTCOLORS_PATCH
static char normbordercolor[] = "#444444";
#if FLOAT_BORDER_COLOR_PATCH
static char normfloatcolor[] = "#db8fd9";
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // !VTCOLORS_PATCH
#endif // !BAR_VTCOLORS_PATCH
static char selfgcolor[] = "#eeeeee";
static char selbgcolor[] = "#005577";
#if !VTCOLORS_PATCH
#if !BAR_VTCOLORS_PATCH
static char selbordercolor[] = "#005577";
#if FLOAT_BORDER_COLOR_PATCH
static char selfloatcolor[] = "#005577";
#endif // FLOAT_BORDER_COLOR_PATCH
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
static char warnfgcolor[] = "#000000";
static char warnbgcolor[] = "#ffff00";
static char warnbordercolor[] = "#ff0000";
#if FLOAT_BORDER_COLOR_PATCH
static char warnfloatcolor[] = "#ffffff";
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_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 // STATUSCOLORS_PATCH
#endif // URGENTBORDER_PATCH // BAR_STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#if BAR_AWESOMEBAR_PATCH
static char hidfgcolor[] = "#005577";
static char hidbgcolor[] = "#222222";
static char hidbordercolor[] = "#005577";
#if FLOAT_BORDER_COLOR_PATCH
static char hidfloatcolor[] = "#f76e0c";
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // AWESOMEBAR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
#if TITLECOLOR_PATCH
#if BAR_TITLECOLOR_PATCH
static char titlefgcolor[] = "#eeeeee";
static char titlebgcolor[] = "#005577";
static char titlebordercolor[] = "#005577";
#if FLOAT_BORDER_COLOR_PATCH
static char titlefloatcolor[] = "#005577";
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // TITLECOLOR_PATCH
#endif // VTCOLORS_PATCH
#endif // BAR_TITLECOLOR_PATCH
#endif // BAR_VTCOLORS_PATCH
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
static const unsigned int alphas[][3] = {
/* fg bg border */
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
[SchemeWarn] = { OPAQUE, baralpha, borderalpha },
#endif // STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
[SchemeUrg] = { OPAQUE, baralpha, borderalpha },
#endif // URGENTBORDER_PATCH / STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#endif // URGENTBORDER_PATCH / BAR_STATUSCOLORS_PATCH
#if BAR_AWESOMEBAR_PATCH
[SchemeHid] = { OPAQUE, baralpha, borderalpha },
#endif // AWESOMEBAR_PATCH
#if VTCOLORS_PATCH
#endif // BAR_AWESOMEBAR_PATCH
#if BAR_VTCOLORS_PATCH
[SchemeTagsNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeTagsSel] = { OPAQUE, baralpha, borderalpha },
[SchemeTitleNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeTitleSel] = { OPAQUE, baralpha, borderalpha },
[SchemeStatus] = { OPAQUE, baralpha, borderalpha },
#elif TITLECOLOR_PATCH
#elif BAR_TITLECOLOR_PATCH
[SchemeTitle] = { OPAQUE, baralpha, borderalpha },
#endif // VTCOLORS_PATCH / TITLECOLOR_PATCH
#endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
};
#endif // ALPHA_PATCH
#if VTCOLORS_PATCH && FLOAT_BORDER_COLOR_PATCH
#endif // BAR_ALPHA_PATCH
#if BAR_VTCOLORS_PATCH && FLOAT_BORDER_COLOR_PATCH
static const char title_bg_dark[] = "#303030";
static const char title_bg_light[] = "#fdfdfd";
static const int color_ptrs[][ColCount] = {
/* fg bg border float */
[SchemeNorm] = { -1, -1, 5, 12 },
[SchemeSel] = { -1, -1, 11, 13 },
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
[SchemeWarn] = { -1, 1, 1, 14 },
#endif // STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
[SchemeUrg] = { 7, 9, 9, 15 },
#endif // URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#endif // URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
#if BAR_AWESOMEBAR_PATCH
[SchemeHid] = { 5, 0, 0, -1 },
#endif // AWESOMEBAR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
[SchemeTagsNorm] = { 2, 0, 0, -1 },
[SchemeTagsSel] = { 6, 5, 5, -1 },
[SchemeTitleNorm] = { 6, -1, -1, -1 },
@ -175,37 +166,37 @@ static char colors[][ColCount][8] = {
/* fg bg border float */
[SchemeNorm] = { "#000000", "#000000", "#000000", "#000000" },
[SchemeSel] = { "#000000", "#000000", "#000000", "#000000" },
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
[SchemeWarn] = { "#000000", "#000000", "#000000", "#000000" },
#endif // STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
[SchemeUrg] = { "#000000", "#000000", "#000000", "#000000" },
#endif // URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#endif // URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
#if BAR_AWESOMEBAR_PATCH
[SchemeHid] = { "#000000", "#000000", "#000000", "#000000" },
#endif // AWESOMEBAR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
[SchemeTagsNorm] = { "#000000", "#000000", "#000000", "#000000" },
[SchemeTagsSel] = { "#000000", "#000000", "#000000", "#000000" },
[SchemeTitleNorm] = { "#000000", "#000000", "#000000", "#000000" },
[SchemeTitleSel] = { "#000000", "#000000", "#000000", "#000000" },
[SchemeStatus] = { "#000000", "#000000", "#000000", "#000000" },
};
#elif VTCOLORS_PATCH
#elif BAR_VTCOLORS_PATCH
static const char title_bg_dark[] = "#303030";
static const char title_bg_light[] = "#fdfdfd";
static const int color_ptrs[][ColCount] = {
/* fg bg border */
[SchemeNorm] = { -1, -1, 5 },
[SchemeSel] = { -1, -1, 11 },
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
[SchemeWarn] = { -1, 1, 1 },
#endif // STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
[SchemeUrg] = { 7, 9, 9 },
#endif // URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#endif // URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
#if BAR_AWESOMEBAR_PATCH
[SchemeHid] = { 5, 0, 0 },
#endif // AWESOMEBAR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
[SchemeTagsNorm] = { 2, 0, 0 },
[SchemeTagsSel] = { 6, 5, 5 },
[SchemeTitleNorm] = { 6, -1, -1 },
@ -216,15 +207,15 @@ static char colors[][ColCount][8] = {
/* fg bg border */
[SchemeNorm] = { "#000000", "#000000", "#000000" },
[SchemeSel] = { "#000000", "#000000", "#000000" },
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
[SchemeWarn] = { "#000000", "#000000", "#000000" },
#endif // STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
[SchemeUrg] = { "#000000", "#000000", "#000000" },
#endif // URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#endif // URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
#if BAR_AWESOMEBAR_PATCH
[SchemeHid] = { "#000000", "#000000", "#000000" },
#endif // AWESOMEBAR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
[SchemeTagsNorm] = { "#000000", "#000000", "#000000" },
[SchemeTagsSel] = { "#000000", "#000000", "#000000" },
[SchemeTitleNorm] = { "#000000", "#000000", "#000000" },
@ -240,20 +231,20 @@ char *colors[][ColCount] = {
/* fg bg border float */
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor },
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
[SchemeWarn] = { warnfgcolor, warnbgcolor, warnbordercolor, warnfloatcolor },
#endif // STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
[SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor },
#endif // URGENTBORDER_PATCH / STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#endif // URGENTBORDER_PATCH / BAR_STATUSCOLORS_PATCH
#if BAR_AWESOMEBAR_PATCH
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidfloatcolor },
#endif // AWESOMEBAR_PATCH
#if TITLECOLOR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
#if BAR_TITLECOLOR_PATCH
[SchemeTitle] = { titlefgcolor, titlebgcolor, titlebordercolor, titlefloatcolor },
#endif // TITLECOLOR_PATCH
#endif // BAR_TITLECOLOR_PATCH
};
#else // !VTCOLORS_PATCH && !FLOAT_BORDER_COLOR_PATCH
#else // !BAR_VTCOLORS_PATCH && !FLOAT_BORDER_COLOR_PATCH
static
#if !XRDB_PATCH
const
@ -262,20 +253,20 @@ char *colors[][ColCount] = {
/* fg bg border */
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
[SchemeWarn] = { warnfgcolor, warnbgcolor, warnbordercolor },
#endif // STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
[SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor },
#endif // URGENTBORDER_PATCH / STATUSCOLORS_PATCH
#if AWESOMEBAR_PATCH
#endif // URGENTBORDER_PATCH / BAR_STATUSCOLORS_PATCH
#if BAR_AWESOMEBAR_PATCH
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor },
#endif // AWESOMEBAR_PATCH
#if TITLECOLOR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
#if BAR_TITLECOLOR_PATCH
[SchemeTitle] = { titlefgcolor, titlebgcolor, titlebordercolor },
#endif // TITLECOLOR_PATCH
#endif // BAR_TITLECOLOR_PATCH
};
#endif // VTCOLORS_PATCH / FLOAT_BORDER_COLOR_PATCH
#endif // BAR_VTCOLORS_PATCH / FLOAT_BORDER_COLOR_PATCH
#if SCRATCHPADS_PATCH
const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL };
@ -290,16 +281,16 @@ static Sp scratchpads[] = {
#endif // SCRATCHPADS_PATCH
/* tagging */
#if EWMHTAGS_PATCH
#if BAR_EWMHTAGS_PATCH
static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
#else
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
#endif // EWMHTAGS_PATCH
#if ALTERNATIVE_TAGS_PATCH
#endif // BAR_EWMHTAGS_PATCH
#if BAR_ALTERNATIVE_TAGS_PATCH
static const char *tagsalt[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
#endif // ALTERNATIVE_TAGS_PATCH
#endif // BAR_ALTERNATIVE_TAGS_PATCH
#if TAGGRID_PATCH
#if BAR_TAGGRID_PATCH
/* grid of tags */
#define DRAWCLASSICTAGS 1 << 0
#define DRAWTAGGRID 1 << 1
@ -315,7 +306,7 @@ static const char *tagsalt[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const unsigned int drawtagmask = DRAWTAGGRID; /* | DRAWCLASSICTAGS to show classic row of tags */
static const int tagrows = 2;
#endif // TAGGRID_PATCH
#endif // BAR_TAGGRID_PATCH
/* There are two options when it comes to per-client rules:
* - a typical struct table or
@ -371,6 +362,62 @@ static const MonitorRule monrules[] = {
#endif // PERTAG_PATCH
#endif // MONITOR_RULES_PATCH
/* Bar rules allow you to configure what is shown where on the bar, as well as
* introducing your own bar modules.
*
* monitor:
* -1 show on all monitors
* 0 show on monitor 0
* 'A' show on active monitor (i.e. focused / selected) (or just -1 for active?)
* bar - bar index, 0 is default, 1 is extrabar
* alignment - how the module is aligned compared to other modules
* widthfunc, drawfunc, clickfunc - providing bar module width, draw and click functions
* name - does nothing, intended for visual clue and for logging / debugging
*/
static const BarRule barrules[] = {
/* monitor bar alignment widthfunc drawfunc clickfunc name */
#if BAR_STATUSBUTTON_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, "statusbutton" },
#endif // BAR_STATUSBUTTON_PATCH
#if BAR_TAGS_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, "tags" },
#endif // BAR_TAGS_PATCH
#if BAR_TAGGRID_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, "taggrid" },
#endif // BAR_TAGGRID_PATCH
#if BAR_LTSYMBOL_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, "layout" },
#endif // BAR_LTSYMBOL_PATCH
#if BAR_SYSTRAY_PATCH
{ 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, "systray" },
#endif // BAR_SYSTRAY_PATCH
#if BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH
{ 'A', 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_statuscmd, "status2d" },
#elif BAR_STATUS2D_PATCH
{ 'A', 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_status2d, "status2d" },
#elif BAR_STATUS_PATCH
{ 'A', 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, "status" },
#endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH
#if BAR_AWESOMEBAR_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, "awesomebar" },
#elif BAR_FANCYBAR_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_fancybar, draw_fancybar, click_fancybar, "fancybar" },
#elif BAR_WINTITLE_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, "wintitle" },
#endif // BAR_AWESOMEBAR_PATCH | BAR_FANCYBAR_PATCH BAR_WINTITLE_PATCH
#if BAR_EXTRASTATUS_PATCH
#if BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_statuscmd_es, "status2d_es" },
#elif BAR_STATUS2D_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_status2d, "status2d_es" },
#elif BAR_STATUSCMD_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_statuscmd_es, "status_es" },
#elif BAR_STATUS_PATCH
{ 'A', 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_status, "status_es" },
#endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH
#endif // BAR_EXTRASTATUS_PATCH
};
#if DWMC_PATCH
/* signal definitions */
/* signum must be greater than 0 */
@ -467,9 +514,9 @@ static Signal signals[] = {
#if SELFRESTART_PATCH
{ "self_restart", self_restart },
#endif // SELFRESTART_PATCH
#if TAGGRID_PATCH
#if BAR_TAGGRID_PATCH
{ "switchtag", switchtag },
#endif // TAGGRID_PATCH
#endif // BAR_TAGGRID_PATCH
#if STICKY_PATCH
{ "togglesticky", togglesticky },
#endif // STICKY_PATCH
@ -495,9 +542,9 @@ static Signal signals[] = {
#if TAGSWAPMON_PATCH
{ "tagswapmon", tagswapmon},
#endif // TAGSWAPMON_PATCH
#if ALTERNATIVE_TAGS_PATCH
#if BAR_ALTERNATIVE_TAGS_PATCH
{ "togglealttag", togglealttag },
#endif // ALTERNATIVE_TAGS_PATCH
#endif // BAR_ALTERNATIVE_TAGS_PATCH
#if TOGGLEFULLSCREEN_PATCH
{ "togglefullscreen", togglefullscreen },
#endif // TOGGLEFULLSCREEN_PATCH
@ -522,7 +569,7 @@ static Signal signals[] = {
#if WINVIEW_PATCH
{ "winview", winview },
#endif // WINVIEW_PATCH
#if XRDB_PATCH && !VTCOLORS_PATCH
#if XRDB_PATCH && !BAR_VTCOLORS_PATCH
{ "xrdb", xrdb },
#endif // XRDB_PATCH
#if TAGOTHERMONITOR_PATCH
@ -549,7 +596,7 @@ static const int nmaster = 1; /* number of clients in master area */
#if FLEXTILE_DELUXE_LAYOUT
static const int nstack = 0; /* number of clients in primary stack area */
#endif // FLEXTILE_DELUXE_LAYOUT
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
#if NROWGRID_LAYOUT
#define FORCE_VSPLIT 1
@ -746,9 +793,9 @@ static const Layout layouts[] = {
{ MOD, XK_z, ACTION##stack, {.i = -1 } },
#endif // STACKER_PATCH
#if HOLDBAR_PATCH
#if BAR_HOLDBAR_PATCH
#define HOLDKEY 0 // replace 0 with the keysym to activate holdbar
#endif // HOLDBAR_PATCH
#endif // BAR_HOLDBAR_PATCH
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
@ -767,18 +814,18 @@ static const char *dmenucmd[] = {
"-nf", normfgcolor,
"-sb", selbgcolor,
"-sf", selfgcolor,
#if DMENUMATCHTOP_PATCH
#if BAR_DMENUMATCHTOP_PATCH
topbar ? NULL : "-b",
#endif // DMENUMATCHTOP_PATCH
#endif // BAR_DMENUMATCHTOP_PATCH
NULL
};
static const char *termcmd[] = { "st", NULL };
#if STATUSCMD_PATCH && !DWMBLOCKS_PATCH
#if BAR_STATUSCMD_PATCH && !BAR_DWMBLOCKS_PATCH
/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */
static const char *statuscmds[] = { "notify-send Mouse$BUTTON" };
static char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };
#endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH
#endif // BAR_STATUSCMD_PATCH | DWMBLOCKS_PATCH
static Key keys[] = {
/* modifier key function argument */
@ -874,9 +921,9 @@ static Key keys[] = {
{ MODKEY|Mod4Mask, XK_Tab, shiftviewclients, { .i = -1 } },
{ MODKEY|Mod4Mask, XK_backslash, shiftviewclients, { .i = +1 } },
#endif // SHIFTVIEW_CLIENTS_PATCH
#if AWESOMEBAR_PATCH
#if BAR_AWESOMEBAR_PATCH
{ MODKEY|ControlMask, XK_z, showhideclient, {0} },
#endif // AWESOMEBAR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
#if KILLUNSEL_PATCH
{ MODKEY|ShiftMask, XK_x, killunsel, {0} },
@ -891,13 +938,13 @@ static Key keys[] = {
#if FOCUSURGENT_PATCH
{ MODKEY, XK_u, focusurgent, {0} },
#endif // FOCUSURGENT_PATCH
#if HOLDBAR_PATCH
#if BAR_HOLDBAR_PATCH
{ 0, HOLDKEY, holdbar, {0} },
#endif // HOLDBAR_PATCH
#endif // BAR_HOLDBAR_PATCH
#if WINVIEW_PATCH
{ MODKEY, XK_o, winview, {0} },
#endif // WINVIEW_PATCH
#if XRDB_PATCH && !VTCOLORS_PATCH
#if XRDB_PATCH && !BAR_VTCOLORS_PATCH
{ MODKEY|ShiftMask, XK_F5, xrdb, {.v = NULL } },
#endif // XRDB_PATCH
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
@ -995,10 +1042,10 @@ static Key keys[] = {
{ MODKEY|Mod4Mask|ControlMask, XK_comma, tagswapmon, {.i = +1 } },
{ MODKEY|Mod4Mask|ControlMask, XK_period, tagswapmon, {.i = -1 } },
#endif // TAGSWAPMON_PATCH
#if ALTERNATIVE_TAGS_PATCH
#if BAR_ALTERNATIVE_TAGS_PATCH
{ MODKEY, XK_n, togglealttag, {0} },
#endif // ALTERNATIVE_TAGS_PATCH
#if TAGGRID_PATCH
#endif // BAR_ALTERNATIVE_TAGS_PATCH
#if BAR_TAGGRID_PATCH
{ MODKEY|ControlMask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_VIEW } },
@ -1007,7 +1054,7 @@ static Key keys[] = {
{ MODKEY|Mod4Mask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
{ MODKEY|Mod4Mask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
{ MODKEY|Mod4Mask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
#endif // TAGGRID_PATCH
#endif // BAR_TAGGRID_PATCH
#if MOVEPLACE_PATCH
{ MODKEY, XK_KP_7, moveplace, {.ui = WIN_NW }}, /* XK_KP_Home, */
{ MODKEY, XK_KP_8, moveplace, {.ui = WIN_N }}, /* XK_KP_Up, */
@ -1148,27 +1195,27 @@ static Command commands[] = {
#endif //
static Button buttons[] = {
/* click event mask button function argument */
#if STATUSBUTTON_PATCH
#if BAR_STATUSBUTTON_PATCH
{ ClkButton, 0, Button1, spawn, {.v = dmenucmd } },
#endif // STATUSBUTTON_PATCH
#endif // BAR_STATUSBUTTON_PATCH
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
#if AWESOMEBAR_PATCH
#if BAR_AWESOMEBAR_PATCH
{ ClkWinTitle, 0, Button1, togglewin, {0} },
{ ClkWinTitle, 0, Button3, showhideclient, {0} },
#endif // AWESOMEBAR_PATCH
#endif // BAR_AWESOMEBAR_PATCH
{ ClkWinTitle, 0, Button2, zoom, {0} },
#if STATUSCMD_PATCH && DWMBLOCKS_PATCH
#if BAR_STATUSCMD_PATCH && BAR_DWMBLOCKS_PATCH
{ ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1 } },
{ ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2 } },
{ ClkStatusText, 0, Button3, sigdwmblocks, {.i = 3 } },
#elif STATUSCMD_PATCH
#elif BAR_STATUSCMD_PATCH
{ ClkStatusText, 0, Button1, spawn, {.v = statuscmd } },
{ ClkStatusText, 0, Button2, spawn, {.v = statuscmd } },
{ ClkStatusText, 0, Button3, spawn, {.v = statuscmd } },
#else
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
#endif // STATUSCMD_PATCH
#endif // BAR_STATUSCMD_PATCH
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },

@ -20,13 +20,13 @@ FREETYPEINC = /usr/include/freetype2
# OpenBSD (uncomment)
#FREETYPEINC = ${X11INC}/freetype2
# Uncomment this for the alpha patch / ALPHA_PATCH
# Uncomment this for the alpha patch / BAR_ALPHA_PATCH
#XRENDER = -lXrender
# Uncomment this for the mdpcontrol patch / MDPCONTROL_PATCH
#MPDCLIENT = -lmpdclient
# Uncomment for the pango patch / PANGO_PATCH
# Uncomment for the pango patch / BAR_PANGO_PATCH
#PANGOINC = `pkg-config --cflags xft pango pangoxft`
#PANGOLIB = `pkg-config --libs xft pango pangoxft`

84
drw.c

@ -61,14 +61,14 @@ utf8decode(const char *c, long *u, size_t clen)
return len;
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
Drw *
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap)
#else
drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
{
Drw *drw = ecalloc(1, sizeof(Drw));
@ -78,7 +78,7 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h
drw->w = w;
drw->h = h;
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
drw->visual = visual;
drw->depth = depth;
drw->cmap = cmap;
@ -87,7 +87,7 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h
#else
drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
drw->gc = XCreateGC(dpy, root, 0, NULL);
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
return drw;
@ -103,11 +103,11 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h)
drw->h = h;
if (drw->drawable)
XFreePixmap(drw->dpy, drw->drawable);
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth);
#else
drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
}
void
@ -115,15 +115,15 @@ drw_free(Drw *drw)
{
XFreePixmap(drw->dpy, drw->drawable);
XFreeGC(drw->dpy, drw->gc);
#if PANGO_PATCH
#if BAR_PANGO_PATCH
drw_font_free(drw->font);
#else
drw_fontset_free(drw->fonts);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
free(drw);
}
#if PANGO_PATCH
#if BAR_PANGO_PATCH
/* This function is an implementation detail. Library users should use
* drw_font_create instead.
*/
@ -192,7 +192,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
die("no font specified.");
}
#if !COLOR_EMOJI_PATCH
#if !BAR_COLOR_EMOJI_PATCH
/* Do not allow using color fonts. This is a workaround for a BadLength
* error from Xft with color glyphs. Modelled on the Xterm workaround. See
* https://bugzilla.redhat.com/show_bug.cgi?id=1498269
@ -205,7 +205,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
XftFontClose(drw->dpy, xfont);
return NULL;
}
#endif // COLOR_EMOJI_PATCH
#endif // BAR_COLOR_EMOJI_PATCH
font = ecalloc(1, sizeof(Fnt));
font->xfont = xfont;
@ -215,25 +215,25 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
return font;
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
static void
xfont_free(Fnt *font)
{
if (!font)
return;
#if PANGO_PATCH
#if BAR_PANGO_PATCH
if (font->layout)
g_object_unref(font->layout);
#else
if (font->pattern)
FcPatternDestroy(font->pattern);
XftFontClose(font->dpy, font->xfont);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
free(font);
}
#if PANGO_PATCH
#if BAR_PANGO_PATCH
Fnt*
drw_font_create(Drw* drw, const char font[])
{
@ -264,9 +264,9 @@ drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
}
return (drw->fonts = ret);
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
#if PANGO_PATCH
#if BAR_PANGO_PATCH
void
drw_font_free(Fnt *font)
{
@ -282,25 +282,25 @@ drw_fontset_free(Fnt *font)
xfont_free(font);
}
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
void
drw_clr_create(
Drw *drw,
Clr *dest,
#if VTCOLORS_PATCH
#if BAR_VTCOLORS_PATCH
const char clrname[]
#else
const char *clrname
#endif // VTCOLORS_PATCH
#if ALPHA_PATCH
#endif // BAR_VTCOLORS_PATCH
#if BAR_ALPHA_PATCH
, unsigned int alpha
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
) {
if (!drw || !dest || !clrname)
return;
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
clrname, dest))
die("error, cannot allocate color '%s'", clrname);
@ -315,7 +315,7 @@ drw_clr_create(
#if NO_TRANSPARENT_BORDERS_PATCH
dest->pixel |= 0xff << 24;
#endif // NO_TRANSPARENT_BORDERS_PATCH
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
}
/* Wrapper to create color schemes. The caller has to call free(3) on the
@ -323,16 +323,16 @@ drw_clr_create(
Clr *
drw_scm_create(
Drw *drw,
#if VTCOLORS_PATCH
#if BAR_VTCOLORS_PATCH
char clrnames[][8],
#elif XRDB_PATCH
char *clrnames[],
#else
const char *clrnames[],
#endif // VTCOLORS_PATCH / XRDB_PATCH
#if ALPHA_PATCH
#endif // BAR_VTCOLORS_PATCH / XRDB_PATCH
#if BAR_ALPHA_PATCH
const unsigned int alphas[],
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
size_t clrcount
) {
size_t i;
@ -343,11 +343,11 @@ drw_scm_create(
return NULL;
for (i = 0; i < clrcount; i++)
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]);
#else
drw_clr_create(drw, &ret[i], clrnames[i]);
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
return ret;
}
@ -358,7 +358,7 @@ drw_setfontset(Drw *drw, Fnt *set)
if (drw)
drw->fonts = set;
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
void
drw_setscheme(Drw *drw, Clr *scm)
@ -379,7 +379,7 @@ drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int
XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
}
#if PANGO_PATCH
#if BAR_PANGO_PATCH
int
drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup)
{
@ -398,13 +398,13 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
} else {
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
#else
d = XftDrawCreate(drw->dpy, drw->drawable,
DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen));
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
x += lpad;
w -= lpad;
}
@ -471,13 +471,13 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
} else {
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
#else
d = XftDrawCreate(drw->dpy, drw->drawable,
DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen));
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
x += lpad;
w -= lpad;
}
@ -579,7 +579,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
return x + (render ? w : 0);
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
void
drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
@ -591,7 +591,7 @@ drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
XSync(drw->dpy, False);
}
#if PANGO_PATCH
#if BAR_PANGO_PATCH
unsigned int
drw_font_getwidth(Drw *drw, const char *text, Bool markup)
{
@ -607,9 +607,9 @@ drw_fontset_getwidth(Drw *drw, const char *text)
return 0;
return drw_text(drw, 0, 0, 0, 0, 0, text, 0);
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
#if PANGO_PATCH
#if BAR_PANGO_PATCH
void
drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup)
{
@ -644,7 +644,7 @@ drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w,
if (h)
*h = font->h;
}
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
Cur *
drw_cur_create(Drw *drw, int shape)

46
drw.h

@ -1,9 +1,9 @@
/* See LICENSE file for copyright and license details. */
#if PANGO_PATCH
#if BAR_PANGO_PATCH
#include <pango/pango.h>
#include <pango/pangoxft.h>
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
typedef struct {
Cursor cursor;
@ -12,13 +12,13 @@ typedef struct {
typedef struct Fnt {
Display *dpy;
unsigned int h;
#if PANGO_PATCH
#if BAR_PANGO_PATCH
PangoLayout *layout;
#else
XftFont *xfont;
FcPattern *pattern;
struct Fnt *next;
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
} Fnt;
#if FLOAT_BORDER_COLOR_PATCH
@ -33,32 +33,32 @@ typedef struct {
Display *dpy;
int screen;
Window root;
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
Visual *visual;
unsigned int depth;
Colormap cmap;
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
Drawable drawable;
GC gc;
Clr *scheme;
#if PANGO_PATCH
#if BAR_PANGO_PATCH
Fnt *font;
#else
Fnt *fonts;
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
} Drw;
/* Drawable abstraction */
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap);
#else
Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
void drw_resize(Drw *drw, unsigned int w, unsigned int h);
void drw_free(Drw *drw);
/* Fnt abstraction */
#if PANGO_PATCH
#if BAR_PANGO_PATCH
Fnt *drw_font_create(Drw* drw, const char font[]);
void drw_font_free(Fnt* set);
unsigned int drw_font_getwidth(Drw *drw, const char *text, Bool markup);
@ -68,33 +68,33 @@ Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount);
void drw_fontset_free(Fnt* set);
unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
/* Colorscheme abstraction */
void drw_clr_create(
Drw *drw,
Clr *dest,
#if VTCOLORS_PATCH
#if BAR_VTCOLORS_PATCH
const char clrname[]
#else
const char *clrname
#endif // VTCOLORS_PATCH
#if ALPHA_PATCH
#endif // BAR_VTCOLORS_PATCH
#if BAR_ALPHA_PATCH
, unsigned int alpha
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
);
Clr *drw_scm_create(
Drw *drw,
#if VTCOLORS_PATCH
#if BAR_VTCOLORS_PATCH
char clrnames[][8],
#elif XRDB_PATCH
char *clrnames[],
#else
const char *clrnames[],
#endif // VTCOLORS_PATCH / XRDB_PATCH
#if ALPHA_PATCH
#endif // BAR_VTCOLORS_PATCH / XRDB_PATCH
#if BAR_ALPHA_PATCH
const unsigned int alphas[],
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
size_t clrcount
);
@ -105,16 +105,16 @@ void drw_cur_free(Drw *drw, Cur *cursor);
/* Drawing context manipulation */
#if !PANGO_PATCH
void drw_setfontset(Drw *drw, Fnt *set);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
void drw_setscheme(Drw *drw, Clr *scm);
/* Drawing functions */
void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
#if PANGO_PATCH
#if BAR_PANGO_PATCH
int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup);
#else
int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
/* Map functions */
void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);

1537
dwm.c

File diff suppressed because it is too large Load Diff

@ -1,67 +0,0 @@
void
hide(Client *c) {
if (!c || HIDDEN(c))
return;
Window w = c->win;
static XWindowAttributes ra, ca;
// more or less taken directly from blackbox's hide() function
XGrabServer(dpy);
XGetWindowAttributes(dpy, root, &ra);
XGetWindowAttributes(dpy, w, &ca);
// prevent UnmapNotify events
XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask);
XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask);
XUnmapWindow(dpy, w);
setclientstate(c, IconicState);
XSelectInput(dpy, root, ra.your_event_mask);
XSelectInput(dpy, w, ca.your_event_mask);
XUngrabServer(dpy);
focus(c->snext);
arrange(c->mon);
}
void
show(Client *c)
{
if (!c || !HIDDEN(c))
return;
XMapWindow(dpy, c->win);
setclientstate(c, NormalState);
arrange(c->mon);
}
void
togglewin(const Arg *arg)
{
Client *c = (Client*)arg->v;
if (c == selmon->sel)
hide(c);
else {
if (HIDDEN(c))
show(c);
focus(c);
restack(selmon);
}
}
void
showhideclient(const Arg *arg)
{
Client *c = (Client*)arg->v;
if (!c)
c = selmon->sel;
if (!c)
return;
if (HIDDEN(c)) {
show(c);
restack(selmon);
} else {
hide(c);
}
}

@ -1,4 +0,0 @@
static void hide(Client *c);
static void show(Client *c);
static void togglewin(const Arg *arg);
static void showhideclient(const Arg *arg);

@ -34,7 +34,7 @@ xinitvisual()
XFree(infos);
if (! visual) {
if (!visual) {
visual = DefaultVisual(dpy, screen);
depth = DefaultDepth(dpy, screen);
cmap = DefaultColormap(dpy, screen);

@ -0,0 +1,157 @@
int
width_awesomebar(Bar *bar, BarWidthArg *a)
{
return a->max_width;
}
int
draw_awesomebar(Bar *bar, BarDrawArg *a)
{
int n = 0, scm, remainder = 0, tabw;
unsigned int i;
#if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD
int x = a->x + lrpad / 2, w = a->w - lrpad;
#elif BAR_TITLE_LEFT_PAD
int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
#elif BAR_TITLE_RIGHT_PAD
int x = a->x, w = a->w - lrpad / 2;
#else
int x = a->x, w = a->w;
#endif // BAR_TITLE_LEFT_PAD | BAR_TITLE_RIGHT_PAD
Client *c;
for (c = bar->mon->clients; c; c = c->next)
if (ISVISIBLE(c))
n++;
if (n > 0) {
remainder = w % n;
tabw = w / n;
for (i = 0, c = bar->mon->clients; c; c = c->next, i++) {
if (!ISVISIBLE(c))
continue;
if (bar->mon->sel == c)
#if BAR_VTCOLORS_PATCH
scm = SchemeTitleSel;
#elif BAR_TITLECOLOR_PATCH
scm = SchemeTitle;
#else
scm = SchemeSel;
#endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
else if (HIDDEN(c))
scm = SchemeHid;
else
#if BAR_VTCOLORS_PATCH
scm = SchemeTitleNorm;
#else
scm = SchemeNorm;
#endif // BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[scm]);
tabw += (i < remainder ? 1 : 0);
#if BAR_PANGO_PATCH
drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0, False);
#else
drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0);
#endif // BAR_PANGO_PATCH
x += tabw;
}
}
return a->x + a->w;
}
int
click_awesomebar(Bar *bar, Arg *arg, BarClickArg *a)
{
int x = 0, n = 0;
Client *c;
for (c = bar->mon->clients; c; c = c->next)
if (ISVISIBLE(c))
n++;
c = bar->mon->clients;
do {
if (!c || !ISVISIBLE(c))
continue;
else
x += (1.0 / (double)n) * a->rel_w;
} while (c && a->rel_x > x && (c = c->next));
if (c) {
arg->v = c;
return ClkWinTitle;
}
return -1;
}
void
hide(Client *c) {
if (!c || HIDDEN(c))
return;
Window w = c->win;
static XWindowAttributes ra, ca;
// more or less taken directly from blackbox's hide() function
XGrabServer(dpy);
XGetWindowAttributes(dpy, root, &ra);
XGetWindowAttributes(dpy, w, &ca);
// prevent UnmapNotify events
XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask);
XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask);
XUnmapWindow(dpy, w);
setclientstate(c, IconicState);
XSelectInput(dpy, root, ra.your_event_mask);
XSelectInput(dpy, w, ca.your_event_mask);
XUngrabServer(dpy);
focus(c->snext);
arrange(c->mon);
}
void
show(Client *c)
{
if (!c || !HIDDEN(c))
return;
XMapWindow(dpy, c->win);
setclientstate(c, NormalState);
arrange(c->mon);
}
void
togglewin(const Arg *arg)
{
Client *c = (Client*)arg->v;
if (!c)
return;
if (c == selmon->sel)
hide(c);
else {
if (HIDDEN(c))
show(c);
focus(c);
restack(selmon);
}
}
void
showhideclient(const Arg *arg)
{
Client *c = (Client*)arg->v;
if (!c)
c = selmon->sel;
if (!c)
return;
if (HIDDEN(c)) {
show(c);
restack(selmon);
} else {
hide(c);
}
}

@ -0,0 +1,8 @@
static int width_awesomebar(Bar *bar, BarWidthArg *a);
static int draw_awesomebar(Bar *bar, BarDrawArg *a);
static int click_awesomebar(Bar *bar, Arg *arg, BarClickArg *a);
static void hide(Client *c);
static void show(Client *c);
static void togglewin(const Arg *arg);
static void showhideclient(const Arg *arg);

@ -0,0 +1,89 @@
int
width_fancybar(Bar *bar, BarWidthArg *a)
{
return a->max_width;
}
int
draw_fancybar(Bar *bar, BarDrawArg *a)
{
int ftw, mw, ew = 0, n = 0;
unsigned int i;
Client *c;
Monitor *m = bar->mon;
#if BAR_PANGO_PATCH
int boxs = drw->font->h / 9;
int boxw = drw->font->h / 6 + 2;
#else
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
#endif // BAR_PANGO_PATCH
#if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD
int x = a->x + lrpad / 2, w = a->w - lrpad;
#elif BAR_TITLE_LEFT_PAD
int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
#elif BAR_TITLE_RIGHT_PAD
int x = a->x, w = a->w - lrpad / 2;
#else
int x = a->x, w = a->w;
#endif // BAR_TITLE_LEFT_PAD | BAR_TITLE_RIGHT_PAD
for (c = m->clients; c; c = c->next) {
if (ISVISIBLE(c))
n++;
}
if (n > 0) {
ftw = TEXTW(m->sel->name);
mw = (ftw >= w || n == 1) ? 0 : (w - ftw) / (n - 1);
i = 0;
for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c) || c == m->sel)
continue;
ftw = TEXTW(c->name);
if (ftw < mw)
ew += (mw - ftw);
else
i++;
}
if (i > 0)
mw += ew / i;
for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c))
continue;
ftw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
#if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[m->sel == c ? SchemeTitleSel : SchemeTitleNorm]);
#elif BAR_TITLECOLOR_PATCH
drw_setscheme(drw, scheme[m->sel == c ? SchemeTitle : SchemeNorm]);
#else
drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
#endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
if (ftw > 0) /* trap special handling of 0 in drw_text */
#if BAR_PANGO_PATCH
drw_text(drw, x, 0, ftw, bh, lrpad / 2, c->name, 0, False);
#else
drw_text(drw, x, 0, ftw, bh, lrpad / 2, c->name, 0);
#endif // BAR_PANGO_PATCH
if (c->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
x += ftw;
w -= ftw;
}
}
return x + w;
}
int
click_fancybar(Bar *bar, Arg *arg, BarClickArg *a)
{
return ClkWinTitle;
}

@ -0,0 +1,3 @@
static int width_fancybar(Bar *bar, BarWidthArg *a);
static int draw_fancybar(Bar *bar, BarDrawArg *a);
static int click_fancybar(Bar *bar, Arg *arg, BarClickArg *a);

@ -0,0 +1,37 @@
void
holdbar(const Arg *arg)
{
if (selmon->showbar)
return;
Bar *bar;
selmon->showbar = 2;
updatebarpos(selmon);
for (bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
}
void
keyrelease(XEvent *e)
{
Bar *bar;
if (XEventsQueued(dpy, QueuedAfterReading)) {
XEvent ne;
XPeekEvent(dpy, &ne);
if (ne.type == KeyPress && ne.xkey.time == e->xkey.time &&
ne.xkey.keycode == e->xkey.keycode) {
XNextEvent(dpy, &ne);
return;
}
}
if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) {
selmon->showbar = 0;
updatebarpos(selmon);
for (bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
arrange(selmon);
}
#if COMBO_PATCH
combo = 0;
#endif // COMBO_PATCH
}

@ -0,0 +1,2 @@
static void keyrelease(XEvent *e);
static void holdbar(const Arg *arg);

@ -0,0 +1,21 @@
int
width_ltsymbol(Bar *bar, BarWidthArg *a)
{
return TEXTW(bar->mon->ltsymbol);
}
int
draw_ltsymbol(Bar *bar, BarDrawArg *a)
{
#if BAR_PANGO_PATCH
return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, bar->mon->ltsymbol, 0, False);
#else
return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, bar->mon->ltsymbol, 0);
#endif // BAR_PANGO_PATCH
}
int
click_ltsymbol(Bar *bar, Arg *arg, BarClickArg *a)
{
return ClkLtSymbol;
}

@ -0,0 +1,3 @@
static int width_ltsymbol(Bar *bar, BarWidthArg *a);
static int draw_ltsymbol(Bar *bar, BarDrawArg *a);
static int click_ltsymbol(Bar *bar, Arg *arg, BarClickArg *a);

@ -0,0 +1,49 @@
int
width_status(Bar *bar, BarWidthArg *a)
{
#if BAR_PANGO_PATCH
return TEXTWM(stext);
#else
return TEXTW(stext);
#endif // BAR_PANGO_PATCH
}
#if BAR_EXTRASTATUS_PATCH
int
width_status_es(Bar *bar, BarWidthArg *a)
{
#if BAR_PANGO_PATCH
return TEXTWM(estext) - lrpad;
#else
return TEXTW(estext) - lrpad;
#endif // BAR_PANGO_PATCH
}
#endif // BAR_EXTRASTATUS_PATCH
int
draw_status(Bar *bar, BarDrawArg *a)
{
#if BAR_PANGO_PATCH
return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, stext, 0, True);
#else
return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, stext, 0);
#endif // BAR_PANGO_PATCH
}
#if BAR_EXTRASTATUS_PATCH
int
draw_status_es(Bar *bar, BarDrawArg *a)
{
#if BAR_PANGO_PATCH
return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0, True);
#else
return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0);
#endif // BAR_PANGO_PATCH
}
#endif // BAR_EXTRASTATUS_PATCH
int
click_status(Bar *bar, Arg *arg, BarClickArg *a)
{
return ClkStatusText;
}

@ -0,0 +1,9 @@
static int width_status(Bar *bar, BarWidthArg *a);
#if BAR_EXTRASTATUS_PATCH
static int width_status_es(Bar *bar, BarWidthArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int draw_status(Bar *bar, BarDrawArg *a);
#if BAR_EXTRASTATUS_PATCH
static int draw_status_es(Bar *bar, BarDrawArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int click_status(Bar *bar, Arg *arg, BarClickArg *a);

@ -1,7 +1,43 @@
int
drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
width_status2d(Bar *bar, BarWidthArg *a)
{
int ret, i, w, x, len;
return status2dtextlength(rawstext) + lrpad;
}
#if BAR_EXTRASTATUS_PATCH
int
width_status2d_es(Bar *bar, BarWidthArg *a)
{
return status2dtextlength(rawestext);
}
#endif // BAR_EXTRASTATUS_PATCH
int
draw_status2d(Bar *bar, BarDrawArg *a)
{
return drawstatusbar(a->x, rawstext);
}
#if BAR_EXTRASTATUS_PATCH
int
draw_status2d_es(Bar *bar, BarDrawArg *a)
{
return drawstatusbar(a->x, rawestext);
}
#endif // BAR_EXTRASTATUS_PATCH
#if !BAR_STATUSCMD_PATCH
int
click_status2d(Bar *bar, Arg *arg, BarClickArg *a)
{
return ClkStatusText;
}
#endif // BAR_STATUSCMD_PATCH
int
drawstatusbar(int x, char* stext)
{
int i, w, len;
short isCode = 0;
char *text;
char *p;
@ -10,58 +46,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
if (!(text = (char*) malloc(sizeof(char)*len)))
die("malloc");
p = text;
#if STATUSCMD_PATCH
#if BAR_STATUSCMD_PATCH
copyvalidchars(text, stext);
#else
memcpy(text, stext, len);
#endif // STATUSCMD_PATCH
#endif // BAR_STATUSCMD_PATCH
/* compute width of the status text */
w = stp * 2;
i = -1;
while (text[++i]) {
if (text[i] == '^') {
if (!isCode) {
isCode = 1;
text[i] = '\0';
#if PANGO_PATCH
w += TEXTWM(text) - lrpad;
#else
w += TEXTW(text) - lrpad;
#endif // PANGO_PATCH
text[i] = '^';
if (text[++i] == 'f')
w += atoi(text + ++i);
} else {
isCode = 0;
text = text + i + 1;
i = -1;
}
}
}
if (!isCode)
#if PANGO_PATCH
w += TEXTWM(text) - lrpad;
#else
w += TEXTW(text) - lrpad;
#endif // PANGO_PATCH
else
isCode = 0;
text = p;
w += 2; /* 1px padding on both sides */
if (align == 0)
x = 0 + stp; // left
else if (align == 1)
x = m->ww - w - stw + stp; // right
else
x = m->ww / 2 - w / 2; // center
ret = w;
drw_setscheme(drw, scheme[LENGTH(colors)]);
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
drw_rect(drw, x - stp - 1, 0, w, bh, 1, 1);
x++;
x += lrpad / 2;
/* process status text */
i = -1;
@ -70,13 +61,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
isCode = 1;
text[i] = '\0';
#if PANGO_PATCH
#if BAR_PANGO_PATCH
w = TEXTWM(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0, True);
#else
w = TEXTW(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
x += w;
@ -90,13 +81,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
}
memcpy(buf, (char*)text+i+1, 7);
buf[7] = '\0';
#if ALPHA_PATCH && STATUS2D_NO_ALPHA_PATCH
#if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColFg], buf, 0xff);
#elif ALPHA_PATCH
#elif BAR_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColFg], buf, alphas[SchemeNorm][ColFg]);
#else
drw_clr_create(drw, &drw->scheme[ColFg], buf);
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
i += 7;
} else if (text[i] == 'b') {
char buf[8];
@ -106,13 +97,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
}
memcpy(buf, (char*)text+i+1, 7);
buf[7] = '\0';
#if ALPHA_PATCH && STATUS2D_NO_ALPHA_PATCH
#if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColBg], buf, 0xff);
#elif ALPHA_PATCH
#elif BAR_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColBg], buf, alphas[SchemeNorm][ColBg]);
#else
drw_clr_create(drw, &drw->scheme[ColBg], buf);
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
i += 7;
} else if (text[i] == 'd') {
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
@ -142,21 +133,21 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
isCode = 0;
}
}
if (!isCode) {
#if PANGO_PATCH
#if BAR_PANGO_PATCH
w = TEXTWM(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0, True);
#else
w = TEXTW(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
x += w;
}
free(p);
drw_setscheme(drw, scheme[SchemeNorm]);
free(p);
return ret;
return x;
}
int
@ -165,16 +156,17 @@ status2dtextlength(char* stext)
int i, w, len;
short isCode = 0;
char *text;
char *p;
len = strlen(stext) + 1;
if (!(text = (char*) malloc(sizeof(char)*len)))
die("malloc");
#if STATUSCMD_PATCH
p = text;
#if BAR_STATUSCMD_PATCH
copyvalidchars(text, stext);
#else
memcpy(text, stext, len);
#endif // STATUSCMD_PATCH
#endif // BAR_STATUSCMD_PATCH
/* compute width of the status text */
w = 0;
@ -184,11 +176,11 @@ status2dtextlength(char* stext)
if (!isCode) {
isCode = 1;
text[i] = '\0';
#if PANGO_PATCH
#if BAR_PANGO_PATCH
w += TEXTWM(text) - lrpad;
#else
w += TEXTW(text) - lrpad;
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
text[i] = '^';
if (text[++i] == 'f')
w += atoi(text + ++i);
@ -200,10 +192,11 @@ status2dtextlength(char* stext)
}
}
if (!isCode)
#if PANGO_PATCH
#if BAR_PANGO_PATCH
w += TEXTWM(text) - lrpad;
#else
w += TEXTW(text) - lrpad;
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
free(p);
return w;
}
}

@ -0,0 +1,13 @@
static int width_status2d(Bar *bar, BarWidthArg *a);
#if BAR_EXTRASTATUS_PATCH
static int width_status2d_es(Bar *bar, BarWidthArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int draw_status2d(Bar *bar, BarDrawArg *a);
#if BAR_EXTRASTATUS_PATCH
static int draw_status2d_es(Bar *bar, BarDrawArg *a);
#endif // BAR_EXTRASTATUS_PATCH
#if !BAR_STATUSCMD_PATCH
static int click_status2d(Bar *bar, Arg *arg, BarClickArg *a);
#endif // BAR_STATUSCMD_PATCH
static int drawstatusbar(int x, char* text);
static int status2dtextlength(char* stext);

@ -0,0 +1,2 @@
static int width_status2d_eb(Bar *bar, BarWidthArg *a);
static int draw_status2d_eb(Bar *bar, BarDrawArg *a);

@ -0,0 +1,21 @@
int
width_stbutton(Bar *bar, BarWidthArg *a)
{
return TEXTW(buttonbar);
}
int
draw_stbutton(Bar *bar, BarDrawArg *a)
{
#if BAR_PANGO_PATCH
return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, buttonbar, 0, False);
#else
return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, buttonbar, 0);
#endif // BAR_PANGO_PATCH
}
int
click_stbutton(Bar *bar, Arg *arg, BarClickArg *a)
{
return ClkButton;
}

@ -0,0 +1,3 @@
static int width_stbutton(Bar *bar, BarWidthArg *a);
static int draw_stbutton(Bar *bar, BarDrawArg *a);
static int click_stbutton(Bar *bar, Arg *arg, BarClickArg *a);

@ -0,0 +1,76 @@
#if !BAR_DWMBLOCKS_PATCH
static const char statusexport[] = "export BUTTON=-;";
static int statuscmdn;
static int lastbutton;
#endif // BAR_DWMBLOCKS_PATCH
int
click_statuscmd(Bar *bar, Arg *arg, BarClickArg *a)
{
return click_statuscmd_text(arg, a->rel_x, rawstext);
}
#if BAR_EXTRASTATUS_PATCH
int
click_statuscmd_es(Bar *bar, Arg *arg, BarClickArg *a)
{
return click_statuscmd_text(arg, a->rel_x, rawestext);
}
#endif // BAR_EXTRASTATUS_PATCH
int
click_statuscmd_text(Arg *arg, int rel_x, char *text)
{
int i = -1;
int x = 0;
char ch;
#if BAR_DWMBLOCKS_PATCH
dwmblockssig = -1;
#else
statuscmdn = 0;
#endif // BAR_DWMBLOCKS_PATCH
while (text[++i]) {
if ((unsigned char)text[i] < ' ') {
ch = text[i];
text[i] = '\0';
#if BAR_STATUS2D_PATCH && !BAR_BAR_STATUSCOLORS_PATCH
x += status2dtextlength(text);
#elif BAR_PANGO_PATCH
x += TEXTWM(text) - lrpad;
#else
x += TEXTW(text) - lrpad;
#endif // STATUS2D_PATCH
text[i] = ch;
text += i+1;
i = -1;
#if BAR_DWMBLOCKS_PATCH
if (x >= rel_x && dwmblockssig != -1)
break;
dwmblockssig = ch;
#else
if (x >= rel_x)
break;
if (ch <= LENGTH(statuscmds))
statuscmdn = ch - 1;
#endif // BAR_DWMBLOCKS_PATCH
}
}
#if BAR_DWMBLOCKS_PATCH
if (dwmblockssig == -1)
dwmblockssig = 0;
#endif // BAR_DWMBLOCKS_PATCH
return ClkStatusText;
}
void
copyvalidchars(char *text, char *rawtext)
{
int i = -1, j = 0;
while (rawtext[++i]) {
if ((unsigned char)rawtext[i] >= ' ') {
text[j++] = rawtext[i];
}
}
text[j] = '\0';
}

@ -0,0 +1,6 @@
static int click_statuscmd(Bar *bar, Arg *arg, BarClickArg *a);
#if BAR_EXTRASTATUS_PATCH
static int click_statuscmd_es(Bar *bar, Arg *arg, BarClickArg *a);
#endif // BAR_EXTRASTATUS_PATCH
static int click_statuscmd_text(Arg *arg, int rel_x, char *text);
static void copyvalidchars(char *text, char *rawtext);

@ -12,11 +12,11 @@ textw_wosc(char *s)
}
ctmp = *ts;
*ts = '\0';
#if PANGO_PATCH
#if BAR_PANGO_PATCH
sw += drw_font_getwidth(drw, tp, True);
#else
sw += drw_fontset_getwidth(drw, tp);
#endif // PANGO_PATCH
#endif // BAR_PANGO_PATCH
*ts = ctmp;
if (ctmp == '\0')
break;

@ -1,75 +1,28 @@
static Systray *systray = NULL;
static unsigned long systrayorientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ;
unsigned int
getsystraywidth()
int
width_systray(Bar *bar, BarWidthArg *a)
{
unsigned int w = 0;
Client *i;
if (!systray)
return 1;
if (showsystray)
for (i = systray->icons; i; w += i->w + systrayspacing, i = i->next);
return w ? w + systrayspacing : 0;
}
void
removesystrayicon(Client *i)
{
Client **ii;
if (!showsystray || !i)
return;
for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
if (ii)
*ii = i->next;
free(i);
}
void
resizerequest(XEvent *e)
{
XResizeRequestEvent *ev = &e->xresizerequest;
Client *i;
if ((i = wintosystrayicon(ev->window))) {
updatesystrayicongeom(i, ev->width, ev->height);
updatesystray();
}
return w ? w + lrpad - systrayspacing : 0;
}
Monitor *
systraytomon(Monitor *m)
int
draw_systray(Bar *bar, BarDrawArg *a)
{
Monitor *t;
int i, n;
if (!systraypinning) {
if (!m)
return selmon;
return m == selmon ? m : NULL;
}
for (n = 1, t = mons; t && t->next; n++, t = t->next);
for (i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next);
if (systraypinningfailfirst && n < systraypinning)
return mons;
return t;
}
if (!showsystray)
return a->x;
void
updatesystray(void)
{
XSetWindowAttributes wa;
XWindowChanges wc;
Client *i;
Monitor *m = systraytomon(NULL);
unsigned int x = m->mx + m->mw;
unsigned int w = 1, xpad = 0, ypad = 0;
#if BARPADDING_PATCH
xpad = sp;
ypad = vp;
#endif // BARPADDING_PATCH
unsigned int w;
if (!showsystray)
return;
if (!systray) {
/* init systray */
if (!(systray = (Systray *)calloc(1, sizeof(Systray))))
@ -77,24 +30,26 @@ updatesystray(void)
wa.override_redirect = True;
wa.event_mask = ButtonPressMask|ExposureMask;
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
wa.border_pixel = 0;
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
wa.background_pixel = 0;
wa.colormap = cmap;
systray->win = XCreateWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, depth,
systray->win = XCreateWindow(dpy, root, bar->bx + a->x + lrpad / 2, bar->by, MAX(a->w + 40, 1), bar->bh, 0, depth,
InputOutput, visual,
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
CWOverrideRedirect|CWBorderPixel|CWBackPixel|CWColormap|CWEventMask, &wa); // CWBackPixmap
#else
systray->win = XCreateSimpleWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, 0, scheme[SchemeNorm][ColBg].pixel);
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
systray->win = XCreateSimpleWindow(dpy, root, bar->bx + a->x + lrpad / 2, bar->by, MIN(a->w, 1), bar->bh, 0, 0, scheme[SchemeNorm][ColBg].pixel);
XChangeWindowAttributes(dpy, systray->win, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &wa);
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
XSelectInput(dpy, systray->win, SubstructureNotifyMask);
XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32,
PropModeReplace, (unsigned char *)&systrayorientation, 1);
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
XChangeProperty(dpy, systray->win, netatom[NetSystemTrayVisual], XA_VISUALID, 32,
PropModeReplace, (unsigned char *)&visual->visualid, 1);
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
XChangeProperty(dpy, systray->win, netatom[NetWMWindowType], XA_ATOM, 32,
PropModeReplace, (unsigned char *)&netatom[NetWMWindowTypeDock], 1);
XMapRaised(dpy, systray->win);
@ -102,43 +57,68 @@ updatesystray(void)
if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) {
sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0);
XSync(dpy, False);
}
else {
} else {
fprintf(stderr, "dwm: unable to obtain system tray.\n");
free(systray);
systray = NULL;
return;
return a->x;
}
}
systray->bar = bar;
drw_setscheme(drw, scheme[SchemeNorm]);
for (w = 0, i = systray->icons; i; i = i->next) {
/* make sure the background color stays the same */
#if BAR_ALPHA_PATCH
wa.background_pixel = 0;
#else
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
#endif // BAR_ALPHA_PATCH
XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa);
XMapRaised(dpy, i->win);
w += systrayspacing;
i->x = w;
XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h);
w += i->w;
if (i->mon != m)
i->mon = m;
if (i->next)
w += systrayspacing;
if (i->mon != bar->mon)
i->mon = bar->mon;
}
XMoveResizeWindow(dpy, systray->win, bar->bx + a->x + lrpad / 2, (w ? bar->by : -bar->by), MAX(w, 1), bar->bh);
return a->x + a->w;
}
int
click_systray(Bar *bar, Arg *arg, BarClickArg *a)
{
return -1;
}
void
removesystrayicon(Client *i)
{
Client **ii;
if (!showsystray || !i)
return;
for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
if (ii)
*ii = i->next;
free(i);
drawbarwin(systray->bar);
}
void
resizerequest(XEvent *e)
{
XResizeRequestEvent *ev = &e->xresizerequest;
Client *i;
if ((i = wintosystrayicon(ev->window))) {
updatesystrayicongeom(i, ev->width, ev->height);
drawbarwin(systray->bar);
}
w = w ? w + systrayspacing : 1;
x -= w;
XMoveResizeWindow(dpy, systray->win, x - xpad, m->by + ypad, w, bh);
wc.x = x - xpad;
wc.y = m->by + ypad;
wc.width = w;
wc.height = bh;
wc.stack_mode = Above; wc.sibling = m->barwin;
XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc);
XMapWindow(dpy, systray->win);
XMapSubwindows(dpy, systray->win);
/* redraw background */
XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh);
XSync(dpy, False);
}
void
@ -197,8 +177,9 @@ updatesystrayiconstate(Client *i, XPropertyEvent *ev)
Client *
wintosystrayicon(Window w)
{
if (!systray)
return NULL;
Client *i = NULL;
if (!showsystray || !w)
return i;
for (i = systray->icons; i && i->win != w; i = i->next);

@ -22,15 +22,18 @@ typedef struct Systray Systray;
struct Systray {
Window win;
Client *icons;
Bar *bar;
};
/* bar integration */
static int width_systray(Bar *bar, BarWidthArg *a);
static int draw_systray(Bar *bar, BarDrawArg *a);
static int click_systray(Bar *bar, Arg *arg, BarClickArg *a);
/* function declarations */
static Atom getatomprop(Client *c, Atom prop);
static unsigned int getsystraywidth();
static void removesystrayicon(Client *i);
static void resizerequest(XEvent *e);
static Monitor *systraytomon(Monitor *m);
static void updatesystray(void);
static void updatesystrayicongeom(Client *i, int w, int h);
static void updatesystrayiconstate(Client *i, XPropertyEvent *ev);
static Client *wintosystrayicon(Window w);

@ -0,0 +1,166 @@
int
width_taggrid(Bar *bar, BarWidthArg *a)
{
return (bh / 2) * (LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0)) + lrpad;
}
int
draw_taggrid(Bar *bar, BarDrawArg *a)
{
unsigned int x, y, h, max_x = 0, columns, occ = 0;
int invert, i,j, k;
Client *c;
for (c = bar->mon->clients; c; c = c->next)
occ |= c->tags;
max_x = x = a->x + lrpad / 2;
h = bh / tagrows;
y = 0;
columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
/* Firstly we will fill the borders of squares */
#if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel);
#else
XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
#endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh);
/* We will draw LENGTH(tags) squares in tagraws raws. */
for (j = 0, i = 0; j < tagrows; j++) {
x = a->x + lrpad / 2;
for (k = 0; k < columns; k++, i++) {
if (i < LENGTH(tags)) {
invert = bar->mon->tagset[bar->mon->seltags] & 1 << i ? 0 : 1;
/* Select active color for current square */
#if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColBg].pixel :
scheme[SchemeTagsNorm][ColFg].pixel);
#else
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColBg].pixel :
scheme[SchemeNorm][ColFg].pixel);
#endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1);
/* Mark square if tag has client */
if (occ & 1 << i) {
#if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColFg].pixel :
scheme[SchemeTagsNorm][ColBg].pixel);
#else
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColFg].pixel :
scheme[SchemeNorm][ColBg].pixel);
#endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1,
h / 2, h / 2);
}
} else {
#if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel);
#else
XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
#endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h);
}
x += h;
if (x > max_x) {
max_x = x;
}
}
y += h;
}
return max_x;
}
int
click_taggrid(Bar *bar, Arg *arg, BarClickArg *a)
{
unsigned int i, columns;
columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
i = (a->rel_x - lrpad / 2) / (bh / tagrows) + columns * (a->rel_y / (bh / tagrows));
if (i >= LENGTH(tags)) {
i = LENGTH(tags) - 1;
}
arg->ui = 1 << i;
return ClkTagBar;
}
void
switchtag(const Arg *arg)
{
unsigned int columns;
unsigned int new_tagset = 0;
unsigned int pos, i;
int col, row;
Arg new_arg;
columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
for (i = 0; i < LENGTH(tags); ++i) {
if (!(selmon->tagset[selmon->seltags] & 1 << i)) {
continue;
}
pos = i;
row = pos / columns;
col = pos % columns;
if (arg->ui & SWITCHTAG_UP) { /* UP */
row --;
if (row < 0) {
row = tagrows - 1;
}
do {
pos = row * columns + col;
row --;
} while (pos >= LENGTH(tags));
}
if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */
row ++;
if (row >= tagrows) {
row = 0;
}
pos = row * columns + col;
if (pos >= LENGTH(tags)) {
row = 0;
}
pos = row * columns + col;
}
if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */
col --;
if (col < 0) {
col = columns - 1;
}
do {
pos = row * columns + col;
col --;
} while (pos >= LENGTH(tags));
}
if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */
col ++;
if (col >= columns) {
col = 0;
}
pos = row * columns + col;
if (pos >= LENGTH(tags)) {
col = 0;
pos = row * columns + col;
}
}
new_tagset |= 1 << pos;
}
new_arg.ui = new_tagset;
if (arg->ui & SWITCHTAG_TOGGLETAG) {
toggletag(&new_arg);
}
if (arg->ui & SWITCHTAG_TAG) {
tag(&new_arg);
}
if (arg->ui & SWITCHTAG_VIEW) {
view (&new_arg);
}
if (arg->ui & SWITCHTAG_TOGGLEVIEW) {
toggleview (&new_arg);
}
}

@ -0,0 +1,4 @@
static int width_taggrid(Bar *bar, BarWidthArg *a);
static int draw_taggrid(Bar *bar, BarDrawArg *a);
static int click_taggrid(Bar *bar, Arg *arg, BarClickArg *a);
static void switchtag(const Arg *arg);

@ -0,0 +1,125 @@
int
width_tags(Bar *bar, BarWidthArg *a)
{
int w, i;
for (w = 0, i = 0; i < LENGTH(tags); i++) {
#if BAR_ALTERNATIVE_TAGS_PATCH
w += selmon->alttag ? TEXTW(tagsalt[i]) : TEXTW(tags[i]);
#else
w += TEXTW(tags[i]);
#endif // BAR_ALTERNATIVE_TAGS_PATCH
}
return w + lrpad;
}
int
draw_tags(Bar *bar, BarDrawArg *a)
{
int invert;
int w, x = a->x + lrpad / 2;
#if BAR_ALTERNATIVE_TAGS_PATCH
int wdelta;
#endif // BAR_ALTERNATIVE_TAGS_PATCH
#if !BAR_HIDEVACANTTAGS_PATCH
#if !BAR_ACTIVETAGINDICATORBAR_PATCH && !BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
#if BAR_PANGO_PATCH
int boxs = drw->font->h / 9;
#else
int boxs = drw->fonts->h / 9;
#endif // BAR_PANGO_PATCH
#endif // BAR_ACTIVETAGINDICATORBAR_PATCH | BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
#if BAR_PANGO_PATCH
int boxw = drw->font->h / 6 + 2;
#else
int boxw = drw->fonts->h / 6 + 2;
#endif // BAR_PANGO_PATCH
#endif // BAR_HIDEVACANTTAGS_PATCH
unsigned int i, occ = 0, urg = 0;
Client *c;
Monitor *m = bar->mon;
for (c = m->clients; c; c = c->next) {
#if BAR_HIDEVACANTTAGS_PATCH
occ |= c->tags == 255 ? 0 : c->tags;
#else
occ |= c->tags;
#endif // BAR_HIDEVACANTTAGS_PATCH
if (c->isurgent)
urg |= c->tags;
}
for (i = 0; i < LENGTH(tags); i++) {
#if URGENTBORDER_PATCH
invert = 0;
#else
invert = urg & 1 << i;
#endif // URGENTBORDER_PATCH
#if BAR_HIDEVACANTTAGS_PATCH
/* do not draw vacant tags */
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
continue;
#endif // BAR_HIDEVACANTTAGS_PATCH
w = TEXTW(tags[i]);
#if BAR_ALTERNATIVE_TAGS_PATCH
wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0;
#endif // BAR_ALTERNATIVE_TAGS_PATCH
#if URGENTBORDER_PATCH
if (m->tagset[m->seltags] & 1 << i)
#if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[SchemeTagsSel]);
#else
drw_setscheme(drw, scheme[SchemeSel]);
#endif // BAR_VTCOLORS_PATCH
else
#if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[urg & 1 << i ? SchemeUrg : SchemeTagsNorm]);
#else
drw_setscheme(drw, scheme[urg & 1 << i ? SchemeUrg : SchemeNorm]);
#endif // BAR_VTCOLORS_PATCH
#elif BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]);
#else // URGENTBORDER_PATCH
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
#endif // URGENTBORDER_PATCH
#if BAR_ALTERNATIVE_TAGS_PATCH && BAR_PANGO_PATCH
drw_text(drw, x, 0, w, bh, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : tags[i]), invert, False);
#elif BAR_ALTERNATIVE_TAGS_PATCH
drw_text(drw, x, 0, w, bh, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : tags[i]), invert);
#elif BAR_PANGO_PATCH
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], invert, False);
#else
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], invert);
#endif // BAR_ALTERNATIVE_TAGS_PATCH
#if !BAR_HIDEVACANTTAGS_PATCH
if (occ & 1 << i)
#if BAR_ACTIVETAGINDICATORBAR_PATCH
drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw,
#elif BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
drw_rect(drw, x + boxw, bh - boxw/2, w - ( 2 * boxw + 1), boxw/2,
#else
drw_rect(drw, x + boxs, boxs, boxw, boxw,
#endif // BAR_ACTIVETAGINDICATORBAR_PATCH
m == selmon && selmon->sel && selmon->sel->tags & 1 << i, invert);
#endif // BAR_HIDEVACANTTAGS_PATCH
x += w;
}
return x;
}
int
click_tags(Bar *bar, Arg *arg, BarClickArg *a)
{
int i = 0, x = lrpad / 2;
do
#if BAR_ALTERNATIVE_TAGS_PATCH
x += selmon->alttag ? TEXTW(tagsalt[i]) : TEXTW(tags[i]);
#else
x += TEXTW(tags[i]);
#endif
while (a->rel_x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags)) {
arg->ui = 1 << i;
}
return ClkTagBar;
}

@ -0,0 +1,3 @@
static int width_tags(Bar *bar, BarWidthArg *a);
static int draw_tags(Bar *bar, BarDrawArg *a);
static int click_tags(Bar *bar, Arg *arg, BarClickArg *a);

@ -0,0 +1,88 @@
int
width_wintitle(Bar *bar, BarWidthArg *a)
{
return a->max_width;
}
int
draw_wintitle(Bar *bar, BarDrawArg *a)
{
#if !BAR_ACTIVETAGINDICATORBAR_PATCH && !BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
#if BAR_PANGO_PATCH
int boxs = drw->font->h / 9;
#else
int boxs = drw->fonts->h / 9;
#endif // BAR_PANGO_PATCH
#endif // BAR_ACTIVETAGINDICATORBAR_PATCH | BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
#if BAR_PANGO_PATCH
int boxw = drw->font->h / 6 + 2;
#else
int boxw = drw->fonts->h / 6 + 2;
#endif // BAR_PANGO_PATCH
#if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD
int x = a->x + lrpad / 2, w = a->w - lrpad;
#elif BAR_TITLE_LEFT_PAD
int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
#elif BAR_TITLE_RIGHT_PAD
int x = a->x, w = a->w - lrpad / 2;
#else
int x = a->x, w = a->w;
#endif // BAR_TITLE_LEFT_PAD | BAR_TITLE_RIGHT_PAD
Monitor *m = bar->mon;
if (m->sel) {
#if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]);
#elif BAR_TITLECOLOR_PATCH
drw_setscheme(drw, scheme[m == selmon ? SchemeTitle : SchemeNorm]);
#else
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
#endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
#if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
XSetErrorHandler(xerrordummy);
#endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
#if BAR_CENTEREDWINDOWNAME_PATCH
int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
#if BAR_PANGO_PATCH
drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0, False);
#else
drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
#endif // BAR_PANGO_PATCH
#else
#if BAR_PANGO_PATCH
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0, False);
#else
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
#endif // BAR_PANGO_PATCH
#endif // BAR_CENTEREDWINDOWNAME_PATCH
#if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
XSync(dpy, False);
XSetErrorHandler(xerror);
#endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
if (m->sel->isfloating)
#if BAR_ACTIVETAGINDICATORBAR_PATCH
drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, m->sel->isfixed, 0);
#elif BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
drw_rect(drw, x + boxw, bh - boxw/2, w - ( 2 * boxw + 1), boxw/2, 0);
#else
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
#endif // BAR_ACTIVETAGINDICATORBAR_PATCH
} else {
#if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[SchemeTitleNorm]);
#else
drw_setscheme(drw, scheme[SchemeNorm]);
#endif // BAR_VTCOLORS_PATCH
drw_rect(drw, x, 0, w, bh, 1, 1);
}
return x + w;
}
int
click_wintitle(Bar *bar, Arg *arg, BarClickArg *a)
{
return ClkWinTitle;
}

@ -0,0 +1,3 @@
static int width_wintitle(Bar *bar, BarWidthArg *a);
static int draw_wintitle(Bar *bar, BarDrawArg *a);
static int click_wintitle(Bar *bar, Arg *arg, BarClickArg *a);

@ -1,12 +1,12 @@
static int combo = 0;
#if !HOLDBAR_PATCH
#if !BAR_HOLDBAR_PATCH
void
keyrelease(XEvent *e)
{
combo = 0;
}
#endif // !HOLDBAR_PATCH
#endif // !BAR_HOLDBAR_PATCH
void
combotag(const Arg *arg)

@ -1,5 +1,5 @@
#if !HOLDBAR_PATCH
#if !BAR_HOLDBAR_PATCH
static void keyrelease(XEvent *e);
#endif // !HOLDBAR_PATCH
#endif // !BAR_HOLDBAR_PATCH
static void combotag(const Arg *arg);
static void comboview(const Arg *arg);

@ -1,99 +0,0 @@
void
holdbar(const Arg *arg)
{
if (selmon->showbar)
return;
selmon->showbar = 2;
updateholdbarpos(selmon);
#if BARPADDING_PATCH
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh);
#else
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
#endif // BARPADDING_PATCH
#if EXTRABAR_PATCH
#if BARPADDING_PATCH
XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh);
#else
XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh);
#endif // BARPADDING_PATCH
#endif // EXTRABAR_PATCH
}
void
keyrelease(XEvent *e)
{
if (XEventsQueued(dpy, QueuedAfterReading)) {
XEvent ne;
XPeekEvent(dpy, &ne);
if (ne.type == KeyPress && ne.xkey.time == e->xkey.time &&
ne.xkey.keycode == e->xkey.keycode) {
XNextEvent(dpy, &ne);
return;
}
}
if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) {
selmon->showbar = 0;
updateholdbarpos(selmon);
#if BARPADDING_PATCH
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh);
#else
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
#endif // BARPADDING_PATCH
#if EXTRABAR_PATCH
#if BARPADDING_PATCH
XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh);
#else
XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh);
#endif // BARPADDING_PATCH
#endif // EXTRABAR_PATCH
arrange(selmon);
}
#if COMBO_PATCH
combo = 0;
#endif // COMBO_PATCH
}
void
updateholdbarpos(Monitor *m)
{
m->wy = m->my;
m->wh = m->mh;
#if EXTRABAR_PATCH
#if BARPADDING_PATCH
m->wh = m->wh - vertpad * m->showbar * 2 - bh * m->showbar * 2;
m->wy = m->showbar ? m->wy + bh + vertpad: m->wy;
if (m->showbar) {
m->by = m->topbar ? m->wy - bh - vertpad: m->wy + m->wh + vertpad;
m->eby = m->topbar ? m->wy + m->wh + vertpad: m->wy - bh - vertpad;
} else {
m->by = -bh - vertpad;
m->eby = -bh - vertpad;
}
#else
m->wh = m->wh - bh * m->showbar * 2;
m->wy = m->showbar ? m->wy + bh : m->wy;
if (m->showbar) {
m->by = m->topbar ? m->wy - bh : m->wy + m->wh;
m->eby = m->topbar ? m->wy + m->wh : m->wy - bh;
} else {
m->by = -bh;
m->eby = -bh;
}
#endif // BARPADDING_PATCH
#elif BARPADDING_PATCH
if (m->showbar) {
m->wh = m->wh - vertpad - bh;
m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad;
m->wy = m->topbar ? m->wy + bh + vp : m->wy;
} else
m->by = -bh - vp;
#else
if (m->showbar) {
m->wh -= bh;
m->by = m->topbar ? m->wy : m->wy + m->wh;
m->wy = m->topbar ? m->wy + bh : m->wy;
} else
m->by = -bh;
#endif // EXTRABAR_PATCH
}

@ -1,3 +0,0 @@
static void keyrelease(XEvent *e);
static void holdbar(const Arg *arg);
static void updateholdbarpos(Monitor *m);

@ -1,45 +1,86 @@
/* Patches */
#if ALPHA_PATCH
#include "alpha.c"
/* Bar functionality */
#if BAR_ALPHA_PATCH
#include "bar_alpha.c"
#endif
#if ALTERNATIVE_TAGS_PATCH
#include "alternativetags.c"
#if BAR_ALTERNATIVE_TAGS_PATCH
#include "bar_alternativetags.c"
#endif
#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH
#include "bar_dwmblocks.c"
#endif
#if BAR_EWMHTAGS_PATCH
#include "bar_ewmhtags.c"
#endif
#if COMBO_PATCH
#include "combo.c"
#endif
#if BAR_HOLDBAR_PATCH
#include "bar_holdbar.c"
#endif
#if BAR_LTSYMBOL_PATCH
#include "bar_ltsymbol.c"
#endif
#if BAR_STATUS_PATCH
#include "bar_status.c"
#endif
#if BAR_STATUS2D_PATCH
#include "bar_status2d.c"
#endif
#if BAR_STATUSBUTTON_PATCH
#include "bar_statusbutton.c"
#endif
#if BAR_STATUSCMD_PATCH
#include "bar_statuscmd.c"
#endif
#if BAR_STATUSCOLORS_PATCH
#include "bar_statuscolors.c"
#endif
#if BAR_TAGS_PATCH
#include "bar_tags.c"
#endif
#if BAR_TAGGRID_PATCH
#include "bar_taggrid.c"
#endif
#if BAR_WINTITLE_PATCH
#include "bar_wintitle.c"
#endif
#if BAR_FANCYBAR_PATCH
#include "bar_fancybar.c"
#endif
#if BAR_AWESOMEBAR_PATCH
#include "bar_awesomebar.c"
#endif
#if BAR_SYSTRAY_PATCH
#include "bar_systray.c"
#endif
#if BAR_VTCOLORS_PATCH
#include "bar_vtcolors.c"
#endif
/* Other patches */
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
#include "attachx.c"
#endif
#if AUTOSTART_PATCH
#include "autostart.c"
#endif
#if AWESOMEBAR_PATCH
#include "awesomebar.c"
#endif
#if CFACTS_PATCH
#include "cfacts.c"
#endif
#if CMDCUSTOMIZE_PATCH
#include "cmdcustomize.c"
#endif
#if COMBO_PATCH
#include "combo.c"
#endif
#if CYCLELAYOUTS_PATCH
#include "cyclelayouts.c"
#endif
#if DRAGCFACT_PATCH && CFACTS_PATCH
#include "dragcfact.c"
#endif
#if DWMBLOCKS_PATCH && STATUSCMD_PATCH
#include "dwmblocks.c"
#endif
#if DWMC_PATCH
#include "dwmc.c"
#elif FSIGNAL_PATCH
#include "fsignal.c"
#endif
#if EWMHTAGS_PATCH
#include "ewmhtags.c"
#endif
#if EXRESIZE_PATCH
#include "exresize.c"
#endif
@ -58,9 +99,6 @@
#if FULLSCREEN_PATCH
#include "fullscreen.c"
#endif
#if HOLDBAR_PATCH
#include "holdbar.c"
#endif
#if INPLACEROTATE_PATCH
#include "inplacerotate.c"
#endif
@ -131,21 +169,9 @@
#if STACKER_PATCH
#include "stacker.c"
#endif
#if STATUS2D_PATCH && !STATUSCOLORS_PATCH
#include "status2d.c"
#endif
#if STATUSCOLORS_PATCH
#include "statuscolors.c"
#endif
#if STATUSCMD_PATCH
#include "statuscmd.c"
#endif
#if STICKY_PATCH
#include "sticky.c"
#endif
#if SYSTRAY_PATCH
#include "systray.c"
#endif
#if SWALLOW_PATCH
#include "swallow.c"
#endif
@ -164,9 +190,6 @@
#if TAGALLMON_PATCH
#include "tagallmon.c"
#endif
#if TAGGRID_PATCH
#include "taggrid.c"
#endif
#if TAGOTHERMONITOR_PATCH
#include "tagothermonitor.c"
#endif
@ -188,9 +211,6 @@
#if VANITYGAPS_PATCH
#include "vanitygaps.c"
#endif
#if VTCOLORS_PATCH
#include "vtcolors.c"
#endif
#if WARP_PATCH
#include "warp.c"
#endif
@ -200,7 +220,7 @@
#if ZOOMSWAP_PATCH
#include "zoomswap.c"
#endif
#if XRDB_PATCH && !VTCOLORS_PATCH
#if XRDB_PATCH && !BAR_VTCOLORS_PATCH
#include "xrdb.c"
#endif
#if DRAGMFACT_PATCH
@ -211,44 +231,44 @@
#include "layout_facts.c"
#endif
#if BSTACK_LAYOUT
#include "bstack.c"
#include "layout_bstack.c"
#endif
#if BSTACKHORIZ_LAYOUT
#include "bstackhoriz.c"
#include "layout_bstackhoriz.c"
#endif
#if CENTEREDMASTER_LAYOUT
#include "centeredmaster.c"
#include "layout_centeredmaster.c"
#endif
#if CENTEREDFLOATINGMASTER_LAYOUT
#include "centeredfloatingmaster.c"
#include "layout_centeredfloatingmaster.c"
#endif
#if COLUMNS_LAYOUT
#include "columns.c"
#include "layout_columns.c"
#endif
#if DECK_LAYOUT
#include "deck.c"
#include "layout_deck.c"
#endif
#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT
#include "fibonacci.c"
#include "layout_fibonacci.c"
#endif
#if FLEXTILE_DELUXE_LAYOUT
#include "flextile-deluxe.c"
#include "layout_flextile-deluxe.c"
#endif
#if GAPPLESSGRID_LAYOUT
#include "gapplessgrid.c"
#include "layout_gapplessgrid.c"
#endif
#if GRIDMODE_LAYOUT
#include "grid.c"
#include "layout_grid.c"
#endif
#if HORIZGRID_LAYOUT
#include "horizgrid.c"
#include "layout_horizgrid.c"
#endif
#if MONOCLE_LAYOUT
#include "monocle.c"
#include "layout_monocle.c"
#endif
#if NROWGRID_LAYOUT
#include "nrowgrid.c"
#include "layout_nrowgrid.c"
#endif
#if TILE_LAYOUT
#include "tile.c"
#endif
#include "layout_tile.c"
#endif

@ -1,28 +1,72 @@
/* Patches */
#if ALPHA_PATCH
#include "alpha.h"
/* Bar functionality */
#if BAR_ALPHA_PATCH
#include "bar_alpha.h"
#endif
#if ALTERNATIVE_TAGS_PATCH
#include "alternativetags.h"
#if BAR_ALTERNATIVE_TAGS_PATCH
#include "bar_alternativetags.h"
#endif
#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH
#include "bar_dwmblocks.h"
#endif
#if BAR_EWMHTAGS_PATCH
#include "bar_ewmhtags.h"
#endif
#if COMBO_PATCH
#include "combo.h"
#endif
#if BAR_HOLDBAR_PATCH
#include "bar_holdbar.h"
#endif
#if BAR_LTSYMBOL_PATCH
#include "bar_ltsymbol.h"
#endif
#if BAR_STATUS_PATCH
#include "bar_status.h"
#endif
#if BAR_STATUS2D_PATCH
#include "bar_status2d.h"
#endif
#if BAR_STATUSBUTTON_PATCH
#include "bar_statusbutton.h"
#endif
#if BAR_STATUSCMD_PATCH
#include "bar_statuscmd.h"
#endif
#if BAR_TAGS_PATCH
#include "bar_tags.h"
#endif
#if BAR_TAGGRID_PATCH
#include "bar_taggrid.h"
#endif
#if BAR_WINTITLE_PATCH
#include "bar_wintitle.h"
#endif
#if BAR_FANCYBAR_PATCH
#include "bar_fancybar.h"
#endif
#if BAR_AWESOMEBAR_PATCH
#include "bar_awesomebar.h"
#endif
#if BAR_SYSTRAY_PATCH
#include "bar_systray.h"
#endif
#if BAR_VTCOLORS_PATCH
#include "bar_vtcolors.h"
#endif
/* Other patches */
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
#include "attachx.h"
#endif
#if AUTOSTART_PATCH
#include "autostart.h"
#endif
#if AWESOMEBAR_PATCH
#include "awesomebar.h"
#endif
#if CFACTS_PATCH
#include "cfacts.h"
#endif
#if CMDCUSTOMIZE_PATCH
#include "cmdcustomize.h"
#endif
#if COMBO_PATCH
#include "combo.h"
#endif
#if CYCLELAYOUTS_PATCH
#include "cyclelayouts.h"
#endif
@ -32,17 +76,11 @@
#if DRAGMFACT_PATCH
#include "dragmfact.h"
#endif
#if DWMBLOCKS_PATCH && STATUSCMD_PATCH
#include "dwmblocks.h"
#endif
#if DWMC_PATCH
#include "dwmc.h"
#elif FSIGNAL_PATCH
#include "fsignal.h"
#endif
#if EWMHTAGS_PATCH
#include "ewmhtags.h"
#endif
#if EXRESIZE_PATCH
#include "exresize.h"
#endif
@ -61,9 +99,6 @@
#if FULLSCREEN_PATCH
#include "fullscreen.h"
#endif
#if HOLDBAR_PATCH
#include "holdbar.h"
#endif
#if INPLACEROTATE_PATCH
#include "inplacerotate.h"
#endif
@ -134,18 +169,9 @@
#if STACKER_PATCH
#include "stacker.h"
#endif
#if STATUS2D_PATCH && !STATUSCOLORS_PATCH
#include "status2d.h"
#endif
#if STATUSCMD_PATCH
#include "statuscmd.h"
#endif
#if STICKY_PATCH
#include "sticky.h"
#endif
#if SYSTRAY_PATCH
#include "systray.h"
#endif
#if SWALLOW_PATCH
#include "swallow.h"
#endif
@ -164,9 +190,6 @@
#if TAGALLMON_PATCH
#include "tagallmon.h"
#endif
#if TAGGRID_PATCH
#include "taggrid.h"
#endif
#if TAGOTHERMONITOR_PATCH
#include "tagothermonitor.h"
#endif
@ -188,9 +211,6 @@
#if VANITYGAPS_PATCH
#include "vanitygaps.h"
#endif
#if VTCOLORS_PATCH
#include "vtcolors.h"
#endif
#if WARP_PATCH
#include "warp.h"
#endif
@ -200,49 +220,49 @@
#if ZOOMSWAP_PATCH
#include "zoomswap.h"
#endif
#if XRDB_PATCH && !VTCOLORS_PATCH
#if XRDB_PATCH && !BAR_VTCOLORS_PATCH
#include "xrdb.h"
#endif
/* Layouts */
#if BSTACK_LAYOUT
#include "bstack.h"
#include "layout_bstack.h"
#endif
#if BSTACKHORIZ_LAYOUT
#include "bstackhoriz.h"
#include "layout_bstackhoriz.h"
#endif
#if CENTEREDMASTER_LAYOUT
#include "centeredmaster.h"
#include "layout_centeredmaster.h"
#endif
#if CENTEREDFLOATINGMASTER_LAYOUT
#include "centeredfloatingmaster.h"
#include "layout_centeredfloatingmaster.h"
#endif
#if COLUMNS_LAYOUT
#include "columns.h"
#include "layout_columns.h"
#endif
#if DECK_LAYOUT
#include "deck.h"
#include "layout_deck.h"
#endif
#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT
#include "fibonacci.h"
#include "layout_fibonacci.h"
#endif
#if FLEXTILE_DELUXE_LAYOUT
#include "flextile-deluxe.h"
#include "layout_flextile-deluxe.h"
#endif
#if GAPPLESSGRID_LAYOUT
#include "gapplessgrid.h"
#include "layout_gapplessgrid.h"
#endif
#if GRIDMODE_LAYOUT
#include "grid.h"
#include "layout_grid.h"
#endif
#if HORIZGRID_LAYOUT
#include "horizgrid.h"
#include "layout_horizgrid.h"
#endif
#if MONOCLE_LAYOUT
#include "monocle.h"
#include "layout_monocle.h"
#endif
#if NROWGRID_LAYOUT
#include "nrowgrid.h"
#include "layout_nrowgrid.h"
#endif
#if TILE_LAYOUT
#include "tile.h"
#endif
#include "layout_tile.h"
#endif

@ -8,11 +8,11 @@ killunsel(const Arg *arg)
for (i = selmon->clients; i; i = i->next) {
if (ISVISIBLE(i) && i != selmon->sel) {
#if SYSTRAY_PATCH
#if BAR_SYSTRAY_PATCH
if (!sendevent(i->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0))
#else
if (!sendevent(i, wmatom[WMDelete]))
#endif // SYSTRAY_PATCH
#endif // BAR_SYSTRAY_PATCH
{
XGrabServer(dpy);
XSetErrorHandler(xerrordummy);

@ -2,13 +2,13 @@ void
movestack(const Arg *arg)
{
Client *c = NULL, *p = NULL, *pc = NULL, *i;
if (arg->i > 0) {
if (!selmon->sel)
return;
/* find the client after selmon->sel */
for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
if (!c)
for (c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
}
else {
/* find the client before selmon->sel */
@ -20,6 +20,7 @@ movestack(const Arg *arg)
if (ISVISIBLE(i) && !i->isfloating)
c = i;
}
/* find the client before selmon->sel and c */
for (i = selmon->clients; i && (!p || !pc); i = i->next) {
if (i->next == selmon->sel)

@ -1,2 +0,0 @@
static int drawstatusbar(Monitor *m, int bh, char* text, int stw, int stp, int align);
static int status2dtextlength(char* stext);

@ -1,18 +0,0 @@
#if !DWMBLOCKS_PATCH
static const char statusexport[] = "export BUTTON=-;";
static int statuscmdn;
static int lastbutton;
#endif // DWMBLOCKS_PATCH
void
copyvalidchars(char *text, char *rawtext)
{
int i = -1, j = 0;
while (rawtext[++i]) {
if ((unsigned char)rawtext[i] >= ' ') {
text[j++] = rawtext[i];
}
}
text[j] = '\0';
}

@ -1 +0,0 @@
static void copyvalidchars(char *text, char *rawtext);

@ -1,118 +0,0 @@
void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ)
{
unsigned int x, y, h, max_x, columns;
int invert, i,j, k;
h = bh / tagrows;
x = max_x = *x_pos;
y = 0;
columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
/* Firstly we will fill the borders of squares */
XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBorder].pixel);
XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh);
/* We will draw LENGTH(tags) squares in tagraws raws. */
for (j = 0, i= 0; j < tagrows; j++) {
x = *x_pos;
for (k = 0; k < columns && i < LENGTH(tags); k++, i++) {
invert = m->tagset[m->seltags] & 1 << i ? 0 : 1;
/* Select active color for current square */
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColBg].pixel :
scheme[SchemeNorm][ColFg].pixel);
XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1);
/* Mark square if tag has client */
if (occ & 1 << i) {
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColFg].pixel :
scheme[SchemeNorm][ColBg].pixel);
XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1,
h / 2, h / 2);
}
x += h;
if (x > max_x) {
max_x = x;
}
}
y += h;
}
*x_pos = max_x + 1;
}
void switchtag(const Arg *arg)
{
unsigned int columns;
unsigned int new_tagset = 0;
unsigned int pos, i;
int col, row;
Arg new_arg;
columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
for (i = 0; i < LENGTH(tags); ++i) {
if (!(selmon->tagset[selmon->seltags] & 1 << i)) {
continue;
}
pos = i;
row = pos / columns;
col = pos % columns;
if (arg->ui & SWITCHTAG_UP) { /* UP */
row --;
if (row < 0) {
row = tagrows - 1;
}
do {
pos = row * columns + col;
row --;
} while (pos >= LENGTH(tags));
}
if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */
row ++;
if (row >= tagrows) {
row = 0;
}
pos = row * columns + col;
if (pos >= LENGTH(tags)) {
row = 0;
}
pos = row * columns + col;
}
if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */
col --;
if (col < 0) {
col = columns - 1;
}
do {
pos = row * columns + col;
col --;
} while (pos >= LENGTH(tags));
}
if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */
col ++;
if (col >= columns) {
col = 0;
}
pos = row * columns + col;
if (pos >= LENGTH(tags)) {
col = 0;
pos = row * columns + col;
}
}
new_tagset |= 1 << pos;
}
new_arg.ui = new_tagset;
if (arg->ui & SWITCHTAG_TOGGLETAG) {
toggletag(&new_arg);
}
if (arg->ui & SWITCHTAG_TAG) {
tag(&new_arg);
}
if (arg->ui & SWITCHTAG_VIEW) {
view (&new_arg);
}
if (arg->ui & SWITCHTAG_TOGGLEVIEW) {
toggleview (&new_arg);
}
}

@ -1,2 +0,0 @@
static void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ);
static void switchtag(const Arg *arg);

@ -30,16 +30,16 @@ loadxrdb()
XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor);
#endif // FLOAT_BORDER_COLOR_PATCH
#if STATUSCOLORS_PATCH
#if BAR_STATUSCOLORS_PATCH
XRDB_LOAD_COLOR("dwm.warnfgcolor", warnfgcolor);
XRDB_LOAD_COLOR("dwm.warnbgcolor", warnbgcolor);
XRDB_LOAD_COLOR("dwm.warnbordercolor", warnbordercolor);
#if FLOAT_BORDER_COLOR_PATCH
XRDB_LOAD_COLOR("dwm.warnfloatcolor", warnfloatcolor);
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // STATUSCOLORS_PATCH
#endif // BAR_STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
#if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor);
XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor);
XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor);
@ -57,14 +57,14 @@ loadxrdb()
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // AWESOMEBAR_PATCH
#if TITLECOLOR_PATCH
#if BAR_TITLECOLOR_PATCH
XRDB_LOAD_COLOR("dwm.titlefgcolor", titlefgcolor);
XRDB_LOAD_COLOR("dwm.titlebgcolor", titlebgcolor);
XRDB_LOAD_COLOR("dwm.titlebordercolor", titlebordercolor);
#if FLOAT_BORDER_COLOR_PATCH
XRDB_LOAD_COLOR("dwm.titlefloatcolor", titlefloatcolor);
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // TITLECOLOR_PATCH
#endif // BAR_TITLECOLOR_PATCH
}
}
}
@ -79,9 +79,9 @@ xrdb(const Arg *arg)
int i;
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i],
#if ALPHA_PATCH
#if BAR_ALPHA_PATCH
alphas[i],
#endif // ALPHA_PATCH
#endif // BAR_ALPHA_PATCH
#if FLOAT_BORDER_COLOR_PATCH
4
#else

@ -10,31 +10,222 @@
* here for grouping purposes.
*/
/* Patches */
/**
* Bar modules
*/
/* This patch changes the rectangle indicating if a tag is used by a client into a bar
* above the tag name for better visibility.
* https://dwm.suckless.org/patches/activetagindicatorbar/
/* 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 ACTIVETAGINDICATORBAR_PATCH 0
#define BAR_AWESOMEBAR_PATCH 0
/* Alternative patch to the activetagindicatorbar patch, adds the bar below the tag
* icon rather than above.
/* This patch depends on statuscmd patch and adds integration with a (patched) dwmblocks
* instance to give a clickable status bar.
* Patch: https://gist.github.com/danbyl/54f7c1d57fc6507242a95b71c3d8fdea
* dwmblocks: https://github.com/torrinfail/dwmblocks
*/
#define BAR_DWMBLOCKS_PATCH 0
/* This patch shows the titles of all visible windows in the status bar
* (as opposed to showing only the selected one).
* Awesomebar takes precedence over fancybar. Fancybar takes precedence over
* the centeredwindowname patch.
* https://dwm.suckless.org/patches/fancybar/
*/
#define BAR_FANCYBAR_PATCH 0
/* Show layout symbol in bar */
#define BAR_LTSYMBOL_PATCH 1
/* This patch adds an option to place tags in rows like in many other window managers.
* https://dwm.suckless.org/patches/taggrid/
*/
#define BAR_TAGGRID_PATCH 0
/* Show status in bar */
#define BAR_STATUS_PATCH 1
/* This patch adds a clickable button to the left hand side of the statusbar.
* https://dwm.suckless.org/patches/statusbutton/
*/
#define BAR_STATUSBUTTON_PATCH 0
/* This patch adds the ability to execute shell commands based on the mouse button and position
* when clicking the status bar. Refer to the website for usage.
* https://dwm.suckless.org/patches/statuscmd/
*/
#define BAR_STATUSCMD_PATCH 0
/* Status2d allows colors and rectangle drawing in your dwm status bar.
* This patch is incompatible with the statuscolors patch which takes precedence.
* This patch is incompatible with the extrabar patch.
* https://dwm.suckless.org/patches/status2d/
*/
#define BAR_STATUS2D_PATCH 0
/* Supplementary patch should you want to disable alpha for the status2d section */
#define BAR_STATUS2D_NO_ALPHA_PATCH 0
/* The systray patch adds systray for the status bar.
* https://dwm.suckless.org/patches/systray/
*/
#define BAR_SYSTRAY_PATCH 0
/* Show tag symbols in bar */
#define BAR_TAGS_PATCH 1
/* Show window title in bar */
#define BAR_WINTITLE_PATCH 1
/* Title bar modules such as wintitle (default), fancybar and awesomebar
* do not by default add left and/or right padding as they take up the
* remaining space. These options allow you explicitly add padding should
* you need it.
*/
#define BAR_TITLE_RIGHT_PAD 0
#define BAR_TITLE_LEFT_PAD 1
/**
* Bar options
*/
#define ACTIVETAGINDICATORBAR_ALT1_PATCH 0
/* The alpha patch adds transparency for the status bar.
* You need to uncomment the corresponding line in config.mk to use the -lXrender library
* when including this patch.
* https://dwm.suckless.org/patches/alpha/
*/
#define ALPHA_PATCH 0
#define BAR_ALPHA_PATCH 0
/* 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 BAR_ALTERNATIVE_TAGS_PATCH 0
/* This patch changes the rectangle indicating if a tag is used by a client into a bar
* above the tag name for better visibility.
* https://dwm.suckless.org/patches/activetagindicatorbar/
*/
#define BAR_ACTIVETAGINDICATORBAR_PATCH 0
/* Alternative patch to the activetagindicatorbar patch, adds the bar below the tag
* icon rather than above.
*/
#define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH 0
/* 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.
* This patch only applies when the BAR_WINTITLE_PATCH module is used.
* https://dwm.suckless.org/patches/centeredwindowname/
*/
#define BAR_CENTEREDWINDOWNAME_PATCH 0
/* This patch enables color emoji in dwm by removing a workaround for a BadLength error
* in the Xft library when color glyphs are used.
* To enable this you will need an updated Xft library that can handle color glyphs otherwise
* dwm will crash on encountering such characters. Note that you will also need a font that
* provides color emojis for this to work.
*/
#define BAR_COLOR_EMOJI_PATCH 0
/* Updates the position of dmenu to match that of the bar. I.e. if topbar is 0 then dmenu
* will appear at the bottom and if 1 then dmenu will appear at the top.
* https://dwm.suckless.org/patches/dmenumatchtop
*/
#define BAR_DMENUMATCHTOP_PATCH 0
/* Originally this was the extrabar patch, but as the handling of extra bars is now built-in
* only the splitting of the status by a designated separator remains. As such this has been
* renamed to more accurately reflect what it does - creating an extra status.
* https://dwm.suckless.org/patches/extrabar/
*/
#define BAR_EXTRASTATUS_PATCH 0
/* 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 BAR_EWMHTAGS_PATCH 0
/* Allows the bar height to be explicitly set rather than being derived from font.
* https://dwm.suckless.org/patches/bar_height/
*/
#define BAR_HEIGHT_PATCH 0
/* This patch prevents dwm from drawing tags with no clients (i.e. vacant) on the bar.
* https://dwm.suckless.org/patches/hide_vacant_tags/
*/
#define BAR_HIDEVACANTTAGS_PATCH 0
/* With this patch dwm's built-in status bar is only shown when HOLDKEY is pressed
* and the bar will now overlay the display.
* http://dwm.suckless.org/patches/holdbar/
*/
#define BAR_HOLDBAR_PATCH 0
/* Sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji).
* This patch is essentially a hack to ignore any errors when drawing text on the status bar.
* https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww
* https://docs.google.com/viewer?a=v&pid=forums&srcid=MDAwODA2MTg0MDQyMjE0OTgzMzMBMDQ3ODQzODkyMTU3NTAyMTMxNTYBX2RUMVNtOUtDQUFKATAuMQEBdjI&authuser=0
*/
#define BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH 0
/* This patch adds vertical and horizontal space between the statusbar and the edge of the screen.
* https://dwm.suckless.org/patches/barpadding/
*/
#define BAR_PADDING_PATCH 0
/* This patch adds simple markup for status messages using pango markup.
* This depends on the pango library v1.44 or greater.
* You need to uncomment the corresponding lines in config.mk to use the pango libraries
* when including this patch.
*
* Note that the pango patch does not protect against the BadLength error from Xft
* when color glyphs are used, which means that dwm will crash if color emoji is used.
*
* If you need color emoji then you may want to install this patched library from the AUR:
* https://aur.archlinux.org/packages/libxft-bgra/
*
* A long term fix for the libXft library is pending approval of this pull request:
* https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1
*
* Also see:
* https://developer.gnome.org/pygtk/stable/pango-markup-language.html
* https://lists.suckless.org/hackers/2004/17285.html
* https://dwm.suckless.org/patches/pango/
*/
#define BAR_PANGO_PATCH 0
/* This patch enables colored text in the status bar. It changes the way colors are defined
* in config.h allowing multiple color combinations for use in the status script.
* This patch is incompatible with and takes precedence over the status2d patch.
* https://dwm.suckless.org/patches/statuscolors/
*/
#define BAR_STATUSCOLORS_PATCH 0
/* This patch adds configuration options for horizontal and vertical padding in the status bar.
* https://dwm.suckless.org/patches/statuspadding/
*/
#define BAR_STATUSPADDING_PATCH 0
/* Adds a new color scheme used by the (selected) window title in the bar.
* https://dwm.suckless.org/patches/titlecolor/
*/
#define BAR_TITLECOLOR_PATCH 0
/* This patch adds the ability for dwm to read colors from the linux virtual console.
* /sys/module/vt/parameters/default_{red,grn,blu}
* Essentially this way the colors you use in your regular tty is "mirrored" to dwm.
* https://dwm.suckless.org/patches/vtcolors/
*/
#define BAR_VTCOLORS_PATCH 0
/***
* Other patches
*/
/* This patch prevents the focus to drift from the active fullscreen client when
* using focusstack().
@ -80,23 +271,6 @@
*/
#define AUTORESIZE_PATCH 0
/* 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
/* Allows the bar height to be explicitly set rather than being derived from font.
* https://dwm.suckless.org/patches/bar_height/
*/
#define BAR_HEIGHT_PATCH 0
/* This patch adds vertical and horizontal space between the statusbar and the edge of the screen.
* https://dwm.suckless.org/patches/barpadding/
*/
#define BARPADDING_PATCH 0
/* 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/
@ -120,12 +294,6 @@
*/
#define CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH 0
/* 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
/* This patch provides the ability to assign different weights to clients in their
* respective stack in tiled layout.
* https://dwm.suckless.org/patches/cfacts/
@ -137,14 +305,6 @@
*/
#define CMDCUSTOMIZE_PATCH 0
/* This patch enables color emoji in dwm by removing a workaround for a BadLength error
* in the Xft library when color glyphs are used.
* To enable this you will need an updated Xft library that can handle color glyphs otherwise
* dwm will crash on encountering such characters. Note that you will also need a font that
* provides color emojis for this to work.
*/
#define COLOR_EMOJI_PATCH 0
/* 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.
@ -157,12 +317,6 @@
*/
#define CYCLELAYOUTS_PATCH 0
/* Updates the position of dmenu to match that of the bar. I.e. if topbar is 0 then dmenu
* will appear at the bottom and if 1 then dmenu will appear at the top.
* https://dwm.suckless.org/patches/dmenumatchtop
*/
#define DMENUMATCHTOP_PATCH 0
/* Similarly to the dragmfact patch this allows you to click and drag clients to change the
* cfact to adjust the client's size in the stack. This patch depends on the cfacts patch.
*/
@ -175,13 +329,6 @@
*/
#define DRAGMFACT_PATCH 0
/* This patch depends on statuscmd patch and adds integration with a (patched) dwmblocks
* instance to give a clickable status bar.
* Patch: https://gist.github.com/danbyl/54f7c1d57fc6507242a95b71c3d8fdea
* dwmblocks: https://github.com/torrinfail/dwmblocks
*/
#define DWMBLOCKS_PATCH 0
/* Simple dwmc client using a fork of fsignal to communicate with dwm.
* To use this either copy the patch/dwmc shell script to somewhere in your path or
* uncomment the following line in Makefile:
@ -197,13 +344,6 @@
*/
#define EMPTYVIEW_PATCH 0
/* 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
/* This patch allows the user to change size and placement of floating windows using only the
* keyboard. It also allows for temporary vertical and horizontal extension of windows similar
* to other WMs fill command.
@ -211,13 +351,6 @@
*/
#define EXRESIZE_PATCH 0
/* This patch will enable an extra status bar in dwm in a similar manner to the dualstatus
* patch. If the primary status is at the top via topbar then the extra status bar will be
* placed at the bottom and vice versa.
* https://dwm.suckless.org/patches/extrabar/
*/
#define EXTRABAR_PATCH 0
/* Only allow clients to "fullscreen" into the space currently given to them.
* As an example, this will allow you to view a fullscreen video in your browser on
* one half of the screen, while having the other half available for other tasks.
@ -233,14 +366,6 @@
*/
#define FAKEFULLSCREEN_CLIENT_PATCH 0
/* This patch shows the titles of all visible windows in the status bar
* (as opposed to showing only the selected one).
* Awesomebar takes precedence over fancybar. Fancybar takes precedence over
* the centeredwindowname patch.
* https://dwm.suckless.org/patches/fancybar/
*/
#define FANCYBAR_PATCH 0
/* This patch allows a different border color to be chosen for floating windows.
* https://dwm.suckless.org/patches/float_border_color/
*/
@ -296,17 +421,6 @@
*/
#define FULLSCREEN_PATCH 0
/* This patch prevents dwm from drawing tags with no clients (i.e. vacant) on the bar.
* https://dwm.suckless.org/patches/hide_vacant_tags/
*/
#define HIDEVACANTTAGS_PATCH 0
/* With this patch dwm's built-in status bar is only shown when HOLDKEY is pressed
* and the bar will now overlay the display.
* http://dwm.suckless.org/patches/holdbar/
*/
#define HOLDBAR_PATCH 0
/* This patch provides a keybinding to rotate all clients in the currently selected
* area (master or stack) without affecting the other area.
* https://dwm.suckless.org/patches/inplacerotate/
@ -318,13 +432,6 @@
*/
#define ISPERMANENT_PATCH 0
/* Sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji).
* This patch is essentially a hack to ignore any errors when drawing text on the status bar.
* https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww
* https://docs.google.com/viewer?a=v&pid=forums&srcid=MDAwODA2MTg0MDQyMjE0OTgzMzMBMDQ3ODQzODkyMTU3NTAyMTMxNTYBX2RUMVNtOUtDQUFKATAuMQEBdjI&authuser=0
*/
#define IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH 0
/* This patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts
* can be performed.
* https://dwm.suckless.org/patches/keymodes/
@ -336,17 +443,12 @@
*/
#define KILLUNSEL_PATCH 0
/* Moves the layout symbol in the status bar to the left hand side.
* http://dwm.suckless.org/patches/leftlayout/
*/
#define LEFTLAYOUT_PATCH 0
/* 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.
* It is also possible to spawn new windows (e.g. a terminal) that end up getting
* focus while the previous window remains in fullscreen. This patch ensures that
* in such scenarios the previous window loses fullscreen.
* https://github.com/bakkeby/patches/tree/master/dwm/dwm-losefullscreen-6.2.diff
* https://github.com/bakkeby/patches/blob/master/dwm/dwm-losefullscreen-6.2.diff
*/
#define LOSEFULLSCREEN_PATCH 0
@ -421,27 +523,6 @@
*/
#define ONLYQUITONEMPTY_PATCH 0
/* This patch adds simple markup for status messages using pango markup.
* This depends on the pango library v1.44 or greater.
* You need to uncomment the corresponding lines in config.mk to use the pango libraries
* when including this patch.
*
* Note that the pango patch does not protect against the BadLength error from Xft
* when color glyphs are used, which means that dwm will crash if color emoji is used.
*
* If you need color emoji then you may want to install this patched library from the AUR:
* https://aur.archlinux.org/packages/libxft-bgra/
*
* A long term fix for the libXft library is pending approval of this pull request:
* https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1
*
* Also see:
* https://developer.gnome.org/pygtk/stable/pango-markup-language.html
* https://lists.suckless.org/hackers/2004/17285.html
* https://dwm.suckless.org/patches/pango/
*/
#define PANGO_PATCH 0
/* The pertag patch adds nmaster, mfacts and layouts per tag rather than per
* monitor (default).
* https://dwm.suckless.org/patches/pertag/
@ -466,6 +547,11 @@
*/
#define PUSH_NO_MASTER_PATCH 0
/* Resets the layout and mfact if there is only one visible client.
* https://dwm.suckless.org/patches/resetlayout/
*/
#define RESETLAYOUT_PATCH 0
/* By default, windows only resize from the bottom right corner. With this
* patch the mouse is warped to the nearest corner and you resize from there.
* https://dwm.suckless.org/patches/resizecorners/
@ -503,7 +589,7 @@
*/
#define SAVEFLOATS_PATCH 0
/* The scratchpads patch allows you to spawn or restore floating terminal windows.
/* The scratchpad patch allows you to spawn or restore floating terminal windows.
* It is typically useful when one need to do some short typing.
* Upgraded to Christian Tenllado's multiple scratchpad version.
* https://lists.suckless.org/hackers/2004/17205.html
@ -511,13 +597,6 @@
*/
#define SCRATCHPADS_PATCH 0
/* The scratchpad patch above automatically resizes and centers the scratchpad window every
* time you spawn it. This alteration of the patch disables that so that the size and position
* of the scratchpad window is retained when you respawn it. If you enable this then you may
* want to also take the centered patch and enable the iscentered flag for floating scratchpads.
*/
#define SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH 0
/* This alternative patch enables a scratchpad feature in dwm similar to the scratchpad
* feature in i3wm.
* https://github.com/GasparVardanyan/dwm-scratchpad
@ -589,81 +668,26 @@
*/
#define STACKER_PATCH 0
/* This patch allows the status text to be fixed to the bar on a specific
* monitor rather than being drawn on the focused monitor.
* The statusallmons patch takes precedence over this patch.
* NB: If used together with the systray patch then consider setting
* systraypinning to statmonval+1.
* https://dwm.suckless.org/patches/staticstatus/
*/
#define STATICSTATUS_PATCH 0
/* Status2d allows colors and rectangle drawing in the dwm status bar.
* This patch is incompatible with the statuscolors patch which takes precedence.
* NB: If using this with dwmblocks then make sure to increase CMDLENGTH in dwmblocks.c
* from 50 (default) to 1024.
* https://dwm.suckless.org/patches/status2d/
*/
#define STATUS2D_PATCH 0
/* Supplementary patch should you want to disable alpha for the status2d section */
#define STATUS2D_NO_ALPHA_PATCH 0
/* This patch draws and updates the statusbar on all monitors.
* https://dwm.suckless.org/patches/statusallmons/
*/
#define STATUSALLMONS_PATCH 0
/* This patch adds a clickable button to the left hand side of the statusbar.
* https://dwm.suckless.org/patches/statusbutton/
*/
#define STATUSBUTTON_PATCH 0
/* This patch enables colored text in the status bar. It changes the way colors are defined
* in config.h allowing multiple color combinations for use in the status script.
* This patch is incompatible with and takes precedence over the status2d patch.
* https://dwm.suckless.org/patches/statuscolors/
*/
#define STATUSCOLORS_PATCH 0
/* This patch adds configuration options for horizontal and vertical padding in the status bar.
* https://dwm.suckless.org/patches/statuspadding/
*/
#define STATUSPADDING_PATCH 0
/* 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
/* This patch adds the ability to execute shell commands based on the mouse button and position
* when clicking the status bar. Refer to the website for usage.
* https://dwm.suckless.org/patches/statuscmd/
*/
#define STATUSCMD_PATCH 0
/* The systray patch adds systray for the status bar.
* https://dwm.suckless.org/patches/systray/
*/
#define SYSTRAY_PATCH 0
/* This patch adds "window swallowing" to dwm as known from Plan 9's windowing system rio.
* Clients marked with isterminal in config.h swallow a window opened by any child process,
* e.g. running xclock in a terminal. Closing the xclock window restores the terminal window
* in the current position.
* This patch depends on the following additional libraries:
* - libxcb
* - Xlib-libxcb
* - xcb-res
* You need to uncomment the corresponding line in config.mk to use the -lX11-xcb, -lxcb
* and -lxcb-res libraries when including this patch.
* https://dwm.suckless.org/patches/swallow/
*/
#define SWALLOW_PATCH 0
/* This patch depends on the pertag patch and makes it possible to switch focus with a single
* shortcut (MOD+s) instead of having to think if you should use MOD+j or MOD+k for reaching
* shortcut (MOD+s) instead of having to think if you should use mod-j or mod-k for reaching
* the previously used window.
* This patch depends on the following additional libraries:
* - libxcb
* - Xlib-libxcb
* - xcb-res
* https://dwm.suckless.org/patches/swapfocus/
*/
#define SWAPFOCUS_PATCH 0
@ -692,7 +716,7 @@
*
* (*) except if the client has been moved between tags or to another monitor
*
* https://github.com/bakkeby/patches/tree/master/dwm/dwm-switchtag-6.2.diff
* https://github.com/bakkeby/patches/blob/master/dwm/dwm-switchtag-6.2.diff
* Also see https://dwm.suckless.org/patches/switchtotag
*/
#define SWITCHTAG_PATCH 0
@ -703,15 +727,10 @@
#define TAGALL_PATCH 0
/* This patch allows you to move all visible windows on a monitor to an adjacent monitor.
* https://github.com/bakkeby/patches/tree/master/dwm/dwm-tagallmon-6.2.diff
* https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagallmon-6.2.diff
*/
#define TAGALLMON_PATCH 0
/* This patch adds an option to place tags in rows like in many other window managers.
* https://dwm.suckless.org/patches/taggrid/
*/
#define TAGGRID_PATCH 0
/* This patch makes new clients attach into the stack area when you toggle a new tag into
* view. This means your master area will remain unchanged when toggling views.
* The allmaster patch will cause all clients in the master area to be left alone. This patch
@ -732,7 +751,7 @@
* monitor until you exit fullscreen view (at which point it will appear on the adjacent
* monitor). This patch allows a fullscreen window to be moved to an adjacent monitor
* while remaining in fullscreen.
* https://github.com/bakkeby/patches/tree/master/dwm/dwm-tagmonfixfs-6.2.diff
* https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagmonfixfs-6.2.diff
*/
#define TAGMONFIXFS_PATCH 0
@ -744,17 +763,12 @@
/* This patch allows you to swap all visible windows on one monitor with those of an
* adjacent monitor.
* https://github.com/bakkeby/patches/tree/master/dwm/dwm-tagswapmon-6.2.diff
* https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagswapmon-6.2.diff
*/
#define TAGSWAPMON_PATCH 0
/* Adds a new color scheme used by the (selected) window title in the bar.
* https://dwm.suckless.org/patches/titlecolor/
*/
#define TITLECOLOR_PATCH 0
/* This patch allows you to toggle fullscreen on and off using a single shortcut key.
* https://github.com/bakkeby/patches/tree/master/dwm/dwm-togglefullscreen-6.2.diff
* https://github.com/bakkeby/patches/blob/master/dwm/dwm-togglefullscreen-6.2.diff
*/
#define TOGGLEFULLSCREEN_PATCH 0
@ -799,13 +813,6 @@
*/
#define VIEWONTAG_PATCH 0
/* This patch adds the ability for dwm to read colors from the linux virtual console.
* /sys/module/vt/parameters/default_{red,grn,blu}
* Essentially this way the colors you use in your regular tty is "mirrored" to dwm.
* https://dwm.suckless.org/patches/vtcolors/
*/
#define VTCOLORS_PATCH 0
/* This patch warps the mouse cursor to the center of the currently focused window or screen
* when the mouse cursor is (a) on a different screen or (b) on top of a different window.
* https://dwm.suckless.org/patches/warp/
@ -817,7 +824,7 @@
* This patch adds the role field to the rule configuration so that one can
* differentiate between, say, Firefox "browser" vs "Preferences" vs "Manager"
* or Google-chrome "browser" vs "pop-up".
* https://github.com/bakkeby/patches/tree/master/dwm/dwm-windowrolerule-6.2.diff
* https://github.com/bakkeby/patches/blob/master/dwm/dwm-windowrolerule-6.2.diff
*/
#define WINDOWROLERULE_PATCH 0
@ -839,7 +846,9 @@
*/
#define ZOOMSWAP_PATCH 0
/* Layouts */
/**
* Layouts
*/
/* Bottomstack layout.
* https://dwm.suckless.org/patches/bottomstack/

Loading…
Cancel
Save