add color options
This commit is contained in:
parent
348c1ed6d6
commit
45242b2980
|
@ -85,6 +85,26 @@
|
|||
- speedwm.col_status14: #6D5E8E
|
||||
- speedwm.col_status15: #ffffff
|
||||
!!
|
||||
!! -/ Color options \-
|
||||
!!
|
||||
!! Color the unselected title (1/0)
|
||||
!!
|
||||
- speedwm.colortitle: 1
|
||||
!!
|
||||
!! Color the selected title.
|
||||
!! Note that if you use the powerline then this may look nicer if its disabled. (1/0)
|
||||
!!
|
||||
- speedwm.colorselectedtitle: 1
|
||||
!!
|
||||
!! Color the hidden title (1/0)
|
||||
!!
|
||||
- speedwm.colorhiddentitle: 1
|
||||
!!
|
||||
!! Color the layout indicator.
|
||||
!! Note that if you use the powerline then this may look nicer disabled. (1/0)
|
||||
!!
|
||||
- speedwm.colorlayout: 1
|
||||
!!
|
||||
!! -/ Task switcher options \-
|
||||
!!
|
||||
!! Menu position vertically
|
||||
|
|
13
options.h
13
options.h
|
@ -135,7 +135,7 @@ static int autoresize = 1; /* Allow resizing clients aut
|
|||
static char font[] = { "NotoSans-Regular:size=8:antialiasing=true" }; /* What font should we use? */
|
||||
static char font2[] = { "fontawesome:size=8" }; /* Second font */
|
||||
static char font3[] = { "Noto Color Emoji:size=8" }; /* Third font */
|
||||
static const char *fonts[] = { font, font2, font3 }; /* All fonts */
|
||||
static char *fonts[] = { font, font2, font3 }; /* All fonts */
|
||||
static char defaultstatus[] = ""; /* What to print when a status bar is not running */
|
||||
|
||||
/* Bar options */
|
||||
|
@ -302,6 +302,17 @@ static char col_status13[] = "#eae1cb";
|
|||
static char col_status14[] = "#6D5E8E";
|
||||
static char col_status15[] = "#ffffff";
|
||||
|
||||
/* Color options
|
||||
*
|
||||
* Title
|
||||
*/
|
||||
static int colortitle = 1; /* Color the unselected title. */
|
||||
static int colorselectedtitle = 1; /* Color the selected title. If you're going to be using Powerlines, the title looks better with this set to 0. */
|
||||
static int colorhiddentitle = 1; /* Color the hidden title. */
|
||||
|
||||
/* Layout */
|
||||
static int colorlayout = 1; /* Color the layout indicator. If you're going to be using Powerlines, the tags look better with this set to 0. */
|
||||
|
||||
/* Opacity settings
|
||||
* These options set the opacity of the status bar modules.
|
||||
* They can be anything from 0 (fully transparent) to 255 (fully opaque).
|
||||
|
|
43
speedwm.c
43
speedwm.c
|
@ -598,10 +598,10 @@ static void updatesizehints(Client *c);
|
|||
static void updatestatus(void);
|
||||
static void updaterules(Client *c);
|
||||
static void updatetitle(Client *c);
|
||||
#if USEWINICON
|
||||
#if USETAGPREVIEW
|
||||
static void updatepreview(void);
|
||||
#endif
|
||||
#if USEWINICON
|
||||
static void updateicon(Client *c);
|
||||
#endif
|
||||
static void updatewindowtype(Client *c);
|
||||
|
@ -2259,7 +2259,14 @@ resizebarwin(m);
|
|||
/* draw the layout bar on the left if layoutposition = 1 and we're not hiding the layout */
|
||||
if (layoutposition && !hidelayout) {
|
||||
w = TEXTW(m->ltsymbol);
|
||||
drw_setscheme(drw, scheme[SchemeLayout]);
|
||||
|
||||
/* color with the bar color if !colorlayout */
|
||||
if (colorlayout) {
|
||||
drw_setscheme(drw, scheme[SchemeLayout]);
|
||||
//} else {
|
||||
// drw_setscheme(drw, scheme[SchemeBar]);
|
||||
}
|
||||
|
||||
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||
}
|
||||
|
||||
|
@ -2333,17 +2340,22 @@ resizebarwin(m);
|
|||
if ((w = m->ww - tw - x) > bh) {
|
||||
#endif
|
||||
if (n > 0 && !hidetitle) {
|
||||
int remainder = w % n;
|
||||
int tabw = (1.0 / (double)n) * w + 1;
|
||||
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) */
|
||||
for (c = m->clients; c; c = c->next) {
|
||||
/* if it's not a window, stop */
|
||||
if (!ISVISIBLE(c))
|
||||
continue;
|
||||
if (m->sel == c)
|
||||
/* selected clients */
|
||||
if (m->sel == c && colorselectedtitle)
|
||||
scm = SchemeTitleSel;
|
||||
else if (HIDDEN(c))
|
||||
/* hidden clients */
|
||||
else if (HIDDEN(c) && colorhiddentitle)
|
||||
scm = SchemeTitleHidden;
|
||||
else
|
||||
/* unselected clients */
|
||||
else if (colortitle)
|
||||
scm = SchemeTitleNorm;
|
||||
|
||||
drw_setscheme(drw, scheme[scm]);
|
||||
|
||||
if (remainder >= 0) {
|
||||
|
@ -2353,16 +2365,18 @@ resizebarwin(m);
|
|||
remainder--;
|
||||
}
|
||||
|
||||
/* draw title and icon */
|
||||
#if USEWINICON
|
||||
if (hideicon) {
|
||||
#endif
|
||||
drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0);
|
||||
#if USEWINICON
|
||||
} else {
|
||||
#if USEWINICON
|
||||
drw_text(drw, x, 0, tabw, bh, lrpad / 2 + (c->icon ? c->icw + iconspacing : 0), c->name, 0);
|
||||
if (c->icon) drw_pic(drw, x + lrpad / 2, (bh - c->ich) / 2, c->icw, c->ich, c->icon);
|
||||
#else
|
||||
drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0);
|
||||
#endif
|
||||
drw_text(drw, x, 0, tabw, bh, lrpad / 2 + (c->icon ? c->icw + iconspacing : 0), c->name, 0); /* draw, with icon spacing and width added */
|
||||
if (c->icon)
|
||||
drw_pic(drw, x + lrpad / 2, (bh - c->ich) / 2, c->icw, c->ich, c->icon); /* draw icon */
|
||||
}
|
||||
#endif
|
||||
|
||||
/* draw sticky window indicator */
|
||||
if (c->issticky && !hidesticky) {
|
||||
|
@ -2374,9 +2388,11 @@ resizebarwin(m);
|
|||
drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
|
||||
}
|
||||
|
||||
/* x = x + title width, ending the title section of the bar */
|
||||
x += tabw;
|
||||
}
|
||||
} else {
|
||||
/* set scheme to the bar scheme so we can draw other stuff later */
|
||||
drw_setscheme(drw, scheme[SchemeBar]);
|
||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||
}
|
||||
|
@ -2385,6 +2401,7 @@ resizebarwin(m);
|
|||
m->bt = n;
|
||||
m->btw = w;
|
||||
|
||||
/* map part of the bar */
|
||||
#if USESYSTRAY
|
||||
drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh);
|
||||
#else
|
||||
|
|
|
@ -166,6 +166,10 @@ ResourcePref resources[] = {
|
|||
{ "menupositionh", INTEGER, &menupositionh },
|
||||
{ "maxwidth", INTEGER, &maxwidth },
|
||||
{ "maxheight", INTEGER, &maxheight },
|
||||
{ "colortitle", INTEGER, &colortitle },
|
||||
{ "colorselectedtitle", INTEGER, &colorselectedtitle },
|
||||
{ "colorhiddentitle", INTEGER, &colorhiddentitle },
|
||||
{ "colorlayout", INTEGER, &colorlayout },
|
||||
|
||||
#if USESYSTRAY
|
||||
{ "systraypinning", INTEGER, &systraypinning },
|
||||
|
|
Loading…
Reference in a new issue