add option for toggling alpha without #if USEALPHA

This commit is contained in:
speedie 2023-01-20 22:22:36 +01:00
parent e3ee09b893
commit 9b69da6a45
6 changed files with 7 additions and 1 deletions

View file

@ -361,6 +361,7 @@ The magic of .Xresources is that it is a universal configuration file. While you
Below is a list of all .Xresources values you can define.
- speedwm.bar.alpha: 1
- speedwm.bar.height: 3
- speedwm.bar.position: 1
- speedwm.bar.paddingoh: 0

View file

@ -4,6 +4,7 @@
!! Alternatively append the values to your existing .Xresources.
!! Bar options
speedwm.bar.alpha: 1 ! Enable alpha (0/1)
speedwm.bar.height: 3 ! Height of the bar in pixels (<num>)
speedwm.bar.position: 1 ! Position of the bar (0: Bottom, 1: Top)
speedwm.bar.paddingoh: 0 ! Horizontal padding (extra space) around the bar in pixels (<num>)

View file

@ -91,6 +91,7 @@ static int iconsize = 15; /* Size of the icon */
static int iconspacing = 5; /* Spacing between the title and icon */
/* Bar options */
static int alpha = 1; /* Enable alpha */
static int barposition = 1; /* Bar position. Top: 1, Bottom: 0 */
static int barheight = 3; /* Bar height in pixels, 0 = calculate automatically */
static int barpaddingov = 0; /* Vertical outer bar padding in pixels. */

View file

@ -709,6 +709,8 @@ general/mainstream .Xresources configurations.
.PP
Below is a list of all .Xresources values you can define.
.IP \[bu] 2
speedwm.bar.alpha: 1
.IP \[bu] 2
speedwm.bar.height: 3
.IP \[bu] 2
speedwm.bar.position: 1

View file

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

View file

@ -112,6 +112,7 @@ ResourcePref resources[] = {
{ "client.decorhints", INTEGER, &decorhints },
{ "client.swallow", INTEGER, &swallowclients },
{ "client.swallowfloating", INTEGER, &swallowfloating },
{ "bar.alpha", INTEGER, &alpha },
{ "bar.height", INTEGER, &barheight },
{ "bar.paddingov", INTEGER, &barpaddingov },
{ "bar.paddingoh", INTEGER, &barpaddingoh },