use hide options

This commit is contained in:
speedie 2022-12-04 22:03:42 +01:00
parent 2bc08520d9
commit d65c4d6a55
11 changed files with 89 additions and 47 deletions

View file

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

View file

@ -1,6 +1,9 @@
int
width_status_basic(Bar *bar, BarWidthArg *a)
{
if (selmon->hidestatus)
return 0;
else
return TEXTW(stext);
}
@ -8,6 +11,9 @@ width_status_basic(Bar *bar, BarWidthArg *a)
int
draw_status_basic(Bar *bar, BarDrawArg *a)
{
if (selmon->hidestatus)
return 0;
else
return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, stext, 0, True);
}
@ -15,5 +21,8 @@ draw_status_basic(Bar *bar, BarDrawArg *a)
int
click_status_basic(Bar *bar, Arg *arg, BarClickArg *a)
{
if (selmon->hidestatus)
return 0;
else
return ClkStatusText;
}

View file

@ -4,12 +4,18 @@ static char lastbutton[] = "-";
int
width_status(Bar *bar, BarWidthArg *a)
{
if (selmon->hidestatus)
return 0;
else
return textlength(rawstext) + lrpad;
}
int
draw_status(Bar *bar, BarDrawArg *a)
{
if (selmon->hidestatus)
return 0;
else
return drawstatustext(a->x, rawstext);
}
@ -158,6 +164,9 @@ textlength(char* stext)
int
click_status(Bar *bar, Arg *arg, BarClickArg *a)
{
if (selmon->hidestatus)
return 0;
else
return click_status_text(arg, a->rel_x, rawstext);
}

View file

@ -1,6 +1,9 @@
int
width_tags_basic(Bar *bar, BarWidthArg *a)
{
if (selmon->hidetags)
return 0;
int w, i;
for (w = 0, i = 0; i < LENGTH(tags); i++) {
@ -12,6 +15,9 @@ width_tags_basic(Bar *bar, BarWidthArg *a)
int
draw_tags_basic(Bar *bar, BarDrawArg *a)
{
if (selmon->hidetags)
return 0;
int invert;
int w, x = a->x;
int boxs = drw->font->h / 9;
@ -43,6 +49,9 @@ draw_tags_basic(Bar *bar, BarDrawArg *a)
int
click_tags_basic(Bar *bar, Arg *arg, BarClickArg *a)
{
if (selmon->hidetags)
return 0;
int i = 0, x = lrpad / 2;
do {

View file

@ -1,6 +1,9 @@
int
width_tags(Bar *bar, BarWidthArg *a)
{
if (selmon->hidetags)
return 0;
int w, i;
unsigned int occ = 0;
int plw = drw->font->h / 2 + 1;
@ -22,6 +25,9 @@ width_tags(Bar *bar, BarWidthArg *a)
int
draw_tags(Bar *bar, BarDrawArg *a)
{
if (selmon->hidetags)
return 0;
int x, w;
int invert;
int plw = drw->font->h / 2 + 1;
@ -83,6 +89,9 @@ draw_tags(Bar *bar, BarDrawArg *a)
int
click_tags(Bar *bar, Arg *arg, BarClickArg *a)
{
if (selmon->hidetags)
return 0;
int i = 0, x = lrpad / 2;
int plw = drw->font->h / 2 + 1;
unsigned int occ = 0;

View file

@ -1,12 +1,18 @@
int
width_title_basic(Bar *bar, BarWidthArg *a)
{
if (selmon->hidetitle)
return 0;
return a->max_width;
}
int
draw_title_basic(Bar *bar, BarDrawArg *a)
{
if (selmon->hidetitle)
return 0;
int boxs = drw->font->h / 9;
int boxw = drw->font->h / 6 + 2;
int x = a->x, w = a->w;
@ -31,5 +37,8 @@ draw_title_basic(Bar *bar, BarDrawArg *a)
int
click_title_basic(Bar *bar, Arg *arg, BarClickArg *a)
{
if (selmon->hidetitle)
return 0;
return ClkWinTitle;
}

View file

@ -1,12 +1,18 @@
int
width_title(Bar *bar, BarWidthArg *a)
{
if (selmon->hidetitle)
return 0;
return a->max_width;
}
int
draw_title(Bar *bar, BarDrawArg *a)
{
if (selmon->hidetitle)
return 0;
int n = 0, scm, remainder = 0, tabw, padding;
unsigned int i;
int x = a->x, w = a->w;
@ -52,6 +58,9 @@ draw_title(Bar *bar, BarDrawArg *a)
int
click_title(Bar *bar, Arg *arg, BarClickArg *a)
{
if (selmon->hidetitle)
return 0;
int x = 0, n = 0;
Client *c;

View file

@ -45,19 +45,19 @@ static char *colstatus[] = {
/* Alpha to use for opacity */
static unsigned int alphas[][3] = {
/* fg bg border/unused */
[SchemeBar] = { OPAQUE, baropacity, baropacity },
[SchemeTitleNorm] = { OPAQUE, normtitleopacity, normtitleopacity },
[SchemeTitleSel] = { OPAQUE, seltitleopacity, seltitleopacity },
[SchemeTitleHidden] = { OPAQUE, hiddenopacity, hiddenopacity },
[SchemeLayout] = { OPAQUE, layoutopacity, layoutopacity },
[SchemeStatus] = { OPAQUE, statusopacity, statusopacity },
[SchemeBorderNorm] = { OPAQUE, normborderopacity, selborderopacity },
[SchemeBorderSel] = { OPAQUE, normborderopacity, selborderopacity },
[SchemeBorderUrg] = { OPAQUE, normborderopacity, selborderopacity },
[SchemeBar] = { opaque, baropacity, baropacity },
[SchemeTitleNorm] = { opaque, normtitleopacity, normtitleopacity },
[SchemeTitleSel] = { opaque, seltitleopacity, seltitleopacity },
[SchemeTitleHidden] = { opaque, hiddenopacity, hiddenopacity },
[SchemeLayout] = { opaque, layoutopacity, layoutopacity },
[SchemeStatus] = { opaque, statusopacity, statusopacity },
[SchemeBorderNorm] = { opaque, normborderopacity, selborderopacity },
[SchemeBorderSel] = { opaque, normborderopacity, selborderopacity },
[SchemeBorderUrg] = { opaque, normborderopacity, selborderopacity },
[SchemeTagsNorm] = { tagselopacity, tagselopacity, tagnormopacity },
[SchemeTagsSel] = { tagselopacity, tagselopacity, tagnormopacity },
[SchemeTagsUrg] = { tagselopacity, tagselopacity, tagnormopacity },
[SchemeSystray] = { OPAQUE, systrayopacity, systrayopacity },
[SchemeSystray] = { opaque, systrayopacity, systrayopacity },
};
/* Colors to use for tags */

View file

@ -280,18 +280,18 @@ static char text_layout15[] = "(L15)"; /* Text for layout 15 *
* These options set the opacity of the status bar modules.
* They can be anything from 0 (fully transparent) to 255 (fully opaque).
*
* You can also set OPAQUE and TRANSPARENT which are the same as 0 and 255 respectively.
* You can also set opaque and transparent which are the same as 0 and 255 respectively.
* To completely disable alpha, disable it in toggle.h.
*/
#define baropacity 160 /* Opacity for the overall bar */
#define layoutopacity 160 /* Opacity for the layout indicator */
#define tagnormopacity OPAQUE /* Opacity for other tags */
#define tagnormopacity opaque /* Opacity for other tags */
#define tagselopacity 160 /* Opacity for the selected tag */
#define normtitleopacity 160 /* Opacity for all other windows in the speedwm bar */
#define seltitleopacity 160 /* Opacity for the focused window in the speedwm bar */
#define normborderopacity OPAQUE /* Opacity for the all window borders except selected */
#define selborderopacity OPAQUE /* Opacity for the selected window border */
#define hiddenopacity 0 /* Opacity for hidden/minimized windows */
#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 statusopacity 160 /* Opacity for speedwm status bar */
#define systrayopacity 160 /* Opacity for the speedwm built in systray */

View file

@ -73,27 +73,6 @@ static Signal signals[] = {
#endif
{ 66, viewtoleft_vacant, {0} },
{ 67, viewtoright_vacant, {0} },
/*
{ 68, togglebartags, {0} },
{ 69, togglebaremptytags, {0} },
{ 70, toggletagpowerline, {0} },
{ 71, toggletitlepowerline, {0} },
{ 72, togglepowerline, {0} },
{ 73, toggletagplshape, {0} },
{ 74, toggletitleplshape, {0} },
{ 75, toggleplshape, {0} },
{ 76, resetpowerline, {0} },
{ 77, togglebartitle, {0} },
{ 78, togglebarunseltitle, {0} },
{ 79, togglebarlt, {0} },
{ 80, togglebarstatus, {0} },
{ 81, togglebarfloat, {0} },
{ 82, togglebarsticky, {0} },
{ 83, togglebaricon, {0} },
{ 84, togglebarpos, {0} },
{ 85, togglelayoutpos, {0} },
{ 86, resetbar, {0} },
*/
{ 87, setbarheight, {.i = +1 } },
{ 88, setbarheight, {.i = -1 } },
{ 89, resetbarheight, {0} },

View file

@ -69,8 +69,8 @@
#define RIGHTOF(a,b) (a.y_org > b.y_org) || \
((a.y_org == b.y_org) && (a.x_org > b.x_org))
#define OPAQUE 0xffU
#define TRANSPARENT 0
#define opaque 0xffU
#define transparent 0
#define MWM_HINTS_FLAGS_FIELD 0
#define MWM_HINTS_DECORATIONS_FIELD 2