separate alphas array for powerline alpha

This commit is contained in:
speedie 2022-12-06 17:21:17 +01:00
parent 3b9490285d
commit fbbd505855
3 changed files with 36 additions and 21 deletions

View file

@ -34,24 +34,38 @@ static char *powerlinecolors[][2] = {
[SchemeStatus] = { col_powerline7_text, col_powerline7 },
};
/* Alpha to use for the powerlines */
static unsigned int powerlinealphas[][3] = {
/* fg bg unused */
[SchemeBar] = { opaque, powerlineopacity, powerlineopacity },
[SchemeTagsNorm] = { opaque, powerlineopacity, powerlineopacity },
[SchemeTagsSel] = { opaque, powerlineopacity, powerlineopacity },
[SchemeTagsUrg] = { opaque, powerlineopacity, powerlineopacity },
[SchemeStatus] = { opaque, powerlineopacity, powerlineopacity },
[SchemeBorderNorm] = { opaque, powerlineopacity, powerlineopacity },
[SchemeBorderSel] = { opaque, powerlineopacity, powerlineopacity },
[SchemeBorderUrg] = { opaque, powerlineopacity, powerlineopacity },
[SchemeStatus] = { opaque, powerlineopacity, powerlineopacity },
};
/* Colors for the status bar (.Xresources) */
static char *colstatus[] = {
col_status0,
col_status1,
col_status2,
col_status3,
col_status4,
col_status5,
col_status6,
col_status7,
col_status8,
col_status9,
col_status10,
col_status11,
col_status12,
col_status13,
col_status14,
col_status15,
col_status0,
col_status1,
col_status2,
col_status3,
col_status4,
col_status5,
col_status6,
col_status7,
col_status8,
col_status9,
col_status10,
col_status11,
col_status12,
col_status13,
col_status14,
col_status15,
};
/* Alpha to use for opacity */

View file

@ -1,7 +1,7 @@
/* speedwm
*
* Below is a configuration file which is technically C source code.
* See the man page (speedie.1) or README.md for help.
* See the man page (speedie.1), README.md, readme.php or https://speedie.gq/projects/speedwm.php (they're all identical) for help.
* See the LICENSE file for license details.
*/
@ -303,6 +303,7 @@ static char text_layout15[] = "(L15)"; /* Text for layout 15 *
#define normborderopacity opaque /* Opacity for the all window borders except selected */
#define selborderopacity opaque /* Opacity for the selected window border */
#define hiddenopacity transparent /* Opacity for hidden/minimized windows */
#define powerlineopacity 160 /* Opacity for the speedwm powerline in the status bar */
#define statusopacity 160 /* Opacity for speedwm status bar */
#define systrayopacity 160 /* Opacity for the speedwm built in systray */

View file

@ -252,7 +252,7 @@ struct Client {
Client *next;
Client *snext;
Client *swallowing;
Client *ishidden;
int ishidden;
Monitor *mon;
Window win;
#if USEIPC
@ -2659,6 +2659,8 @@ hidewin(Client *c) {
if (!c || HIDDEN(c))
return;
c->ishidden = 1; /* is hidden */
Window w = c->win;
static XWindowAttributes ra, ca;
@ -2672,8 +2674,6 @@ hidewin(Client *c) {
XSelectInput(dpy, root, ra.your_event_mask);
XSelectInput(dpy, w, ca.your_event_mask);
XUngrabServer(dpy);
c->ishidden = 1; /* is hidden */
}
#if USEIPC
@ -5158,7 +5158,7 @@ setup(void)
tagscheme[i] = drw_scm_create(drw, tagsel[i], tagalpha, 2);
powerlinescheme = ecalloc(LENGTH(powerlinecolors), sizeof(Clr *));
for (i = 0; i < LENGTH(powerlinecolors); i++)
powerlinescheme[i] = drw_scm_create(drw, powerlinecolors[i], alphas[i], 2);
powerlinescheme[i] = drw_scm_create(drw, powerlinecolors[i], powerlinealphas[i], 2);
/* init bars */
updatebars();
updatestatus();