Fix awesomebar title (no longer print garbage), change color values to

better represent what they do
This commit is contained in:
speediegq 2022-10-18 21:14:05 +02:00
parent ca79b290b9
commit e70576b4af
5 changed files with 122 additions and 73 deletions

View file

@ -6,16 +6,19 @@
/* Misc color options
*/
static char *colors[][3] = {
[SchemeBar] = { col_textnorm, col_background, col_windowbordernorm },
[SchemeTags] = { col_textnorm, col_background, col_windowbordernorm },
[SchemeBorderNorm] = { col_textnorm, col_background, col_windowbordernorm },
[SchemeBorderSel] = { col_textsel, col_windowbordernorm, col_windowbordersel },
[SchemeStatus] = { col_textnorm, col_background, col_textsel },
[SchemeTitleNorm] = { col_textnorm, col_background, col_background },
[SchemeTitleSel] = { col_textsel, col_title, col_textsel },
[SchemeTitleHidden] = { col_title, col_background, col_title },
[SchemeLayout] = { col_layouttext, col_layout, col_layout },
[SchemeSystray] = { col_systraybg, col_systraybg, col_systraybg },
[SchemeBar] = { col_textnorm, col_background, NULL },
[SchemeTagsNorm] = { col_textnorm, col_background, NULL },
[SchemeTagsSel] = { col_textsel, col_titlesel, NULL },
[SchemeTagsUrg] = { col_textnorm, col_tagurgent, NULL },
[SchemeBorderNorm] = { col_textnorm, col_windowbordernorm, col_windowbordernorm },
[SchemeBorderSel] = { col_textsel, col_windowbordersel, col_windowbordersel },
[SchemeBorderUrg] = { col_textnorm, col_windowbordersel, col_windowborderurg },
[SchemeStatus] = { col_textnorm, col_background, NULL },
[SchemeTitleNorm] = { col_textnorm, col_titlenorm, NULL },
[SchemeTitleSel] = { col_textsel, col_titlesel, NULL },
[SchemeTitleHidden] = { col_titlesel, col_background, NULL },
[SchemeLayout] = { col_layouttext, col_layout, NULL },
[SchemeSystray] = { col_systraybg, col_systraybg, NULL },
/* text background window border
*/
};
@ -48,11 +51,13 @@ static unsigned int alphas[][3] = {
[SchemeBar] = { OPAQUE, baropacity, baropacity },
[SchemeTitleNorm] = { OPAQUE, normtitleopacity, normtitleopacity },
[SchemeTitleSel] = { OPAQUE, seltitleopacity, seltitleopacity },
[SchemeTitleHidden] = { OPAQUE, hiddenopacity, hiddenopacity },
[SchemeLayout] = { OPAQUE, layoutopacity, layoutopacity },
[SchemeStatus] = { OPAQUE, statusopacity, statusopacity },
[SchemeTitleHidden] = { OPAQUE, hiddenopacity, hiddenopacity },
[SchemeBorderNorm] = { OPAQUE, normborderopacity, selborderopacity },
[SchemeTags] = { tagselopacity, tagselopacity, tagnormopacity },
[SchemeTagsNorm] = { tagselopacity, tagselopacity, tagnormopacity },
[SchemeTagsSel] = { tagselopacity, tagselopacity, tagnormopacity },
[SchemeTagsUrg] = { tagselopacity, tagselopacity, tagnormopacity },
[SchemeSystray] = { OPAQUE, systrayopacity, systrayopacity },
};

View file

@ -17,7 +17,9 @@
!! -/ Bar colors \-
!!
- speedwm.col_background: #222222
- speedwm.col_title: #99b3ff
- speedwm.col_titlenorm: #222222
- speedwm.col_titlesel: #99b3ff
- speedwm.col_titlehid: #222222
!!
!! -/ Bar text colors \-
!!
@ -28,6 +30,7 @@
!!
- speedwm.col_windowbordersel: #eeeeee
- speedwm.col_windowbordernorm: #000000
- speedwm.col_windowborderurg: #f0e68c
!!
!! -/ Tag colors \-
!!
@ -49,6 +52,7 @@
- speedwm.col_tag8_text: #eeeeee
- speedwm.col_tag9: #99b3ff
- speedwm.col_tag9_text: #eeeeee
- speedwm.col_tagurgent: #f0e68c
!!
!! -/ Layout indicator colors \-
!!
@ -131,6 +135,10 @@
!!
!! -/ Window options \-
!!
!! Allow windows to have the urgent property. This allows windows to change the tag color or window border color. (0/1)
!!
- speedwm.allowurgent: 1
!!
!! Border size (in pixels)
!!
- speedwm.bordersize: 1

View file

@ -122,6 +122,7 @@ static int barpreview = 0; /* Display the bar in the pre
static int scalepreview = 2; /* Size of tag preview. Lower is bigger, higher is smaller. */
/* Window spawning options */
static int allowurgent = 1; /* Allow windows to have the 'urgent' status */
static int attachdirection = 3; /* 0 default, 1 above, 2 aside, 3 below, 4 bottom, 5 top */
static int swallowclients = 1; /* Swallow windows or not */
static int swallowfloating = 1; /* Swallow floating windows by default */
@ -247,36 +248,40 @@ static int resetgaps = 1; /* Reset gaps when there is o
/* Colors
*
* Bar colors */
static char col_background[] = "#222222"; /* speedwm bar background and status background color */
static char col_title[] = "#99b3ff"; /* speedwm taskbar background color */
static char col_background[] = "#222222"; /* Bar background and status background color */
static char col_titlenorm[] = "#222222"; /* Normal taskbar background color */
static char col_titlesel[] = "#99b3ff"; /* Selected taskbar background color */
static char col_titlehid[] = "#222222"; /* Hidden taskbar background color */
/* General text colors */
static char col_textnorm[] = "#bbbbbb"; /* application title bar/font for norm */
static char col_textsel[] = "#eeeeee"; /* speedwm text/font for selected */
static char col_textnorm[] = "#bbbbbb"; /* Normal Application title bar/font */
static char col_textsel[] = "#eeeeee"; /* Selected Text/Font color */
/* Window border colors */
static char col_windowbordernorm[] = "#000000"; /* speedwm norm window border */
static char col_windowbordersel[] = "#eeeeee"; /* speedwm sel window border */
static char col_windowbordernorm[] = "#000000"; /* Normal window border */
static char col_windowbordersel[] = "#eeeeee"; /* Selected window border */
static char col_windowborderurg[] = "#f0e68c"; /* Urgent window border */
/* Tag text/background colors */
static char col_tag1[] = "#99b3ff"; /* tag 1 background */
static char col_tag1_text[] = "#eeeeee"; /* tag 1 text (fg) */
static char col_tag2[] = "#99b3ff"; /* tag 2 background */
static char col_tag2_text[] = "#eeeeee"; /* tag 2 text (fg) */
static char col_tag3[] = "#99b3ff"; /* tag 3 background */
static char col_tag3_text[] = "#eeeeee"; /* tag 3 text (fg) */
static char col_tag4[] = "#99b3ff"; /* tag 4 background */
static char col_tag4_text[] = "#eeeeee"; /* tag 4 text (fg) */
static char col_tag5[] = "#99b3ff"; /* tag 5 background */
static char col_tag5_text[] = "#eeeeee"; /* tag 5 text (fg) */
static char col_tag6[] = "#99b3ff"; /* tag 6 background */
static char col_tag6_text[] = "#eeeeee"; /* tag 6 text (fg) */
static char col_tag7[] = "#99b3ff"; /* tag 7 background */
static char col_tag7_text[] = "#eeeeee"; /* tag 7 text (fg) */
static char col_tag8[] = "#99b3ff"; /* tag 8 background */
static char col_tag8_text[] = "#eeeeee"; /* tag 8 text (fg) */
static char col_tag9[] = "#99b3ff"; /* tag 9 background */
static char col_tag9_text[] = "#eeeeee"; /* tag 9 text (fg) */
static char col_tag1[] = "#99b3ff"; /* Tag 1 background */
static char col_tag1_text[] = "#eeeeee"; /* Tag 1 text */
static char col_tag2[] = "#99b3ff"; /* Tag 2 background */
static char col_tag2_text[] = "#eeeeee"; /* Tag 2 text */
static char col_tag3[] = "#99b3ff"; /* Tag 3 background */
static char col_tag3_text[] = "#eeeeee"; /* Tag 3 text */
static char col_tag4[] = "#99b3ff"; /* Tag 4 background */
static char col_tag4_text[] = "#eeeeee"; /* Tag 4 text */
static char col_tag5[] = "#99b3ff"; /* Tag 5 background */
static char col_tag5_text[] = "#eeeeee"; /* Tag 5 text */
static char col_tag6[] = "#99b3ff"; /* Tag 6 background */
static char col_tag6_text[] = "#eeeeee"; /* Tag 6 text */
static char col_tag7[] = "#99b3ff"; /* Tag 7 background */
static char col_tag7_text[] = "#eeeeee"; /* Tag 7 text */
static char col_tag8[] = "#99b3ff"; /* Tag 8 background */
static char col_tag8_text[] = "#eeeeee"; /* Tag 8 text */
static char col_tag9[] = "#99b3ff"; /* Tag 9 background */
static char col_tag9_text[] = "#eeeeee"; /* Tag 9 text */
static char col_tagurgent[] = "#f0e68c"; /* Urgent tag color */
/* Layout indicator colors */
static char col_layouttext[] = "#000000"; /* Layout indicator text */
@ -286,22 +291,22 @@ static char col_layout[] = "#99b3ff"; /* Layout indicator b
static char col_systraybg[] = "#222222"; /* Systray background color */
/* Status colors */
static char col_status0[] = "#131210";
static char col_status1[] = "#bf616a";
static char col_status2[] = "#A16F9D";
static char col_status3[] = "#68ABAA";
static char col_status4[] = "#A89F93";
static char col_status5[] = "#D3A99B";
static char col_status6[] = "#AFC9AC";
static char col_status7[] = "#eae1cb";
static char col_status8[] = "#a39d8e";
static char col_status9[] = "#6D5E8E";
static char col_status10[] = "#A16F9D";
static char col_status11[] = "#D3A99B";
static char col_status12[] = "#AFC9AC";
static char col_status13[] = "#eae1cb";
static char col_status14[] = "#6D5E8E";
static char col_status15[] = "#ffffff";
static char col_status0[] = "#131210"; /* Status color 0 */
static char col_status1[] = "#bf616a"; /* Status color 1 */
static char col_status2[] = "#A16F9D"; /* Status color 2 */
static char col_status3[] = "#68ABAA"; /* Status color 3 */
static char col_status4[] = "#A89F93"; /* Status color 4 */
static char col_status5[] = "#D3A99B"; /* Status color 5 */
static char col_status6[] = "#AFC9AC"; /* Status color 6 */
static char col_status7[] = "#eae1cb"; /* Status color 7 */
static char col_status8[] = "#a39d8e"; /* Status color 8 */
static char col_status9[] = "#6D5E8E"; /* Status color 9 */
static char col_status10[] = "#A16F9D"; /* Status color 10 */
static char col_status11[] = "#D3A99B"; /* Status color 11 */
static char col_status12[] = "#AFC9AC"; /* Status color 12 */
static char col_status13[] = "#eae1cb"; /* Status color 13 */
static char col_status14[] = "#6D5E8E"; /* Status color 14 */
static char col_status15[] = "#ffffff"; /* Status color 15 */
/* Color options
*

View file

@ -101,12 +101,16 @@ enum { CurNormal, CurResize, CurMove, CurResizeHorzArrow, CurResizeVertArrow, Cu
/* color schemes */
enum { SchemeBorderNorm,
SchemeBorderSel,
SchemeTags,
SchemeBorderUrg,
SchemeTagsNorm,
SchemeTagsSel,
SchemeTagsUrg,
SchemeBar,
SchemeTitleHidden,
SchemeLayout,
SchemeTitleNorm,
SchemeTitleSel,
SchemeTitleHidden,
SchemeTitleUrg,
SchemeLayout,
SchemeStatus,
SchemeSystray,
};
@ -1229,7 +1233,7 @@ buttonpress(XEvent *e)
statuscmdn = ch;
}
}
} else {
} else if (!hideunselectedtitle) {
if (!layoutposition && !hidelayout) {
x += TEXTW(m->ltsymbol); /* Left layout does not need this */
}
@ -2272,20 +2276,27 @@ resizebarwin(m);
if (!hidetags) {
for (i = 0; i < LENGTH(tags); i++) {
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i) && hideemptytags)
continue;
continue;
if (!hidetags) {
tagtext = occ & 1 << i ? usedtags[i] : tags[i];
w = TEXTW(tagtext);
/* draw powerlined tags */
if (!hidetagpowerline) {
prevscheme = scheme[SchemeTags]; /* previous scheme = scheme */
drw_settrans(drw, prevscheme, (nxtscheme = scheme[m->tagset[m->seltags] & 1 << i ? SchemeTitleSel : SchemeBar])); /* set transition colorscheme */
prevscheme = scheme[SchemeBar]; /* previous scheme = scheme */
if (urg & 1 << i && allowurgent)
drw_settrans(drw, prevscheme, (nxtscheme = scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsUrg])); /* set transition colorscheme */
else
drw_settrans(drw, prevscheme, (nxtscheme = scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm])); /* set transition colorscheme */
drw_arrow(drw, x, 0, plw, bh, 1, 0); /* draw arrow */
drw_setscheme(drw, nxtscheme); /* set scheme to next scheme */
x += plw;
drw_setscheme(drw, nxtscheme); /* set scheme to next scheme */
} else {
drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeTags])); /* set scheme */
if (urg & 1 << i && allowurgent)
drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeTagsUrg])); /* set scheme */
else
drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeTagsNorm])); /* set scheme */
}
/* draw tag text */
@ -2340,13 +2351,16 @@ resizebarwin(m);
if (n > 0 && !hidetitle) {
int remainder = w % n; /* remainder of the title area */
int tabw = (1.0 / (double)n) * w + 1; /* width of each tab (client in the title area) */
int docontinue; /* whether or not we should (have) continue(ed) or not */
for (c = m->clients; c; c = c->next) {
/* if it's not a window, stop */
if (!ISVISIBLE(c))
continue;
/* hide unselected title */
else if (m->sel != c && hideunselectedtitle)
else if (m->sel != c && hideunselectedtitle) {
docontinue = 1; /* we're going to continue */
continue;
}
/* selected clients */
if (m->sel == c && colorselectedtitle)
@ -2367,6 +2381,13 @@ resizebarwin(m);
remainder--;
}
/* set scheme if we didn't set it earlier (because we ended the for) */
if (docontinue) {
remainder--;
tabw = 1 * w;
drw_setscheme(drw, scheme[SchemeTitleSel]);
}
/* draw title and icon */
#if USEWINICON
if (hideicon) {
@ -6060,11 +6081,14 @@ updatewmhints(Client *c)
XWMHints *wmh;
if ((wmh = XGetWMHints(dpy, c->win))) {
if (c == selmon->sel && wmh->flags & XUrgencyHint) {
if (c == selmon->sel && wmh->flags & XUrgencyHint && allowurgent) {
wmh->flags &= ~XUrgencyHint;
XSetWMHints(dpy, c->win, wmh);
} else
} else if (allowurgent) {
c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0;
if (c->isurgent)
XSetWindowBorder(dpy, c->win, scheme[SchemeBorderUrg][ColBorder].pixel);
}
if (wmh->flags & InputHint)
c->neverfocus = !wmh->input;
else

View file

@ -11,9 +11,12 @@ ResourcePref resources[] = {
{ "font2", STRING, &font2 },
{ "font3", STRING, &font3 },
{ "col_background", STRING, &col_background },
{ "col_title", STRING, &col_title },
{ "col_windowbordersel", STRING, &col_windowbordersel },
{ "col_titlenorm", STRING, &col_titlenorm },
{ "col_titlesel", STRING, &col_titlesel },
{ "col_titlehid", STRING, &col_titlehid },
{ "col_windowbordernorm", STRING, &col_windowbordernorm },
{ "col_windowbordersel", STRING, &col_windowbordersel },
{ "col_windowborderurg", STRING, &col_windowborderurg },
{ "col_layout", STRING, &col_layout },
{ "col_layouttext", STRING, &col_layouttext },
{ "col_textnorm", STRING, &col_textnorm },
@ -36,6 +39,7 @@ ResourcePref resources[] = {
{ "col_tag8_text", STRING, &col_tag8_text },
{ "col_tag9", STRING, &col_tag9 },
{ "col_tag9_text", STRING, &col_tag9_text },
{ "col_tagurgent", STRING, &col_tagurgent },
{ "col_status0", STRING, &col_status0 },
{ "col_status1", STRING, &col_status1 },
{ "col_status2", STRING, &col_status2 },
@ -57,7 +61,9 @@ ResourcePref resources[] = {
/* pywal support */
{ "color0", STRING, &col_background },
{ "color0", STRING, &col_systraybg },
{ "color4", STRING, &col_title },
{ "color0", STRING, &col_titlenorm },
{ "color4", STRING, &col_titlesel },
{ "color0", STRING, &col_titlehid },
{ "color8", STRING, &col_windowbordersel },
{ "color0", STRING, &col_windowbordernorm },
{ "color4", STRING, &col_textnorm },
@ -137,6 +143,7 @@ ResourcePref resources[] = {
{ "hidestatus", INTEGER, &hidestatus },
{ "hidesticky", INTEGER, &hidesticky },
{ "hidefloating", INTEGER, &hidefloating },
{ "allowurgent", INTEGER, &allowurgent },
{ "statusallmons", INTEGER, &statusallmons },
{ "resetlayout", INTEGER, &resetlayout },
{ "resetmfact", INTEGER, &resetmfact },
@ -149,10 +156,10 @@ ResourcePref resources[] = {
{ "underlinestroke", INTEGER, &underlinestroke },
{ "underlinevoffset", INTEGER, &underlinevoffset },
{ "enablegaps", INTEGER, &enablegaps },
{ "gapsizeih", INTEGER, &gapsizeih },
{ "gapsizeiv", INTEGER, &gapsizeiv },
{ "gapsizeoh", INTEGER, &gapsizeoh },
{ "gapsizeov", INTEGER, &gapsizeov },
{ "gapsizeih", INTEGER, &gapsizeih },
{ "gapsizeiv", INTEGER, &gapsizeiv },
{ "gapsizeoh", INTEGER, &gapsizeoh },
{ "gapsizeov", INTEGER, &gapsizeov },
{ "smartgaps", INTEGER, &smartgaps },
{ "smartgapsize", INTEGER, &smartgapsize },
{ "mousemfact", INTEGER, &mousemfact },