mirror of
https://github.com/hnhx/rice.git
synced 2025-01-24 18:23:28 -03:00
added bar padding and change alpha of the bar
This commit is contained in:
parent
931fb71178
commit
d5b20738ec
9 changed files with 138 additions and 31 deletions
|
@ -6,6 +6,8 @@ static const unsigned int gappx = 5; /* gaps between windows */
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
static const int vertpad = 10; /* vertical padding of bar */
|
||||||
|
static const int sidepad = 10; /* horizontal padding of bar */
|
||||||
static const char *fonts[] = { "monospace:size=10" };
|
static const char *fonts[] = { "monospace:size=10" };
|
||||||
static const char dmenufont[] = "monospace:size=10";
|
static const char dmenufont[] = "monospace:size=10";
|
||||||
static const char col_gray1[] = "#222222";
|
static const char col_gray1[] = "#222222";
|
||||||
|
|
|
@ -6,6 +6,8 @@ static const unsigned int gappx = 5; /* gaps between windows */
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
static const int vertpad = 10; /* vertical padding of bar */
|
||||||
|
static const int sidepad = 10; /* horizontal padding of bar */
|
||||||
static const char *fonts[] = { "monospace:size=10" };
|
static const char *fonts[] = { "monospace:size=10" };
|
||||||
static const char dmenufont[] = "monospace:size=10";
|
static const char dmenufont[] = "monospace:size=10";
|
||||||
static const char col_gray1[] = "#222222";
|
static const char col_gray1[] = "#222222";
|
||||||
|
@ -13,11 +15,18 @@ static const char col_gray2[] = "#444444";
|
||||||
static const char col_gray3[] = "#bbbbbb";
|
static const char col_gray3[] = "#bbbbbb";
|
||||||
static const char col_gray4[] = "#eeeeee";
|
static const char col_gray4[] = "#eeeeee";
|
||||||
static const char col_cyan[] = "#005577";
|
static const char col_cyan[] = "#005577";
|
||||||
|
static const unsigned int baralpha = 0xd0;
|
||||||
|
static const unsigned int borderalpha = OPAQUE;
|
||||||
static const char *colors[][3] = {
|
static const char *colors[][3] = {
|
||||||
/* fg bg border */
|
/* fg bg border */
|
||||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||||
};
|
};
|
||||||
|
static const unsigned int alphas[][3] = {
|
||||||
|
/* fg bg border */
|
||||||
|
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
|
||||||
|
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
|
||||||
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
|
|
11
suckless/dwm/config.def.h.rej
Normal file
11
suckless/dwm/config.def.h.rej
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--- config.def.h
|
||||||
|
+++ config.def.h
|
||||||
|
@@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
+static const int horizpadbar = 2; /* horizontal padding for statusbar */
|
||||||
|
+static const int vertpadbar = 0; /* vertical padding for statusbar */
|
||||||
|
static const char *fonts[] = { "monospace:size=10" };
|
||||||
|
static const char dmenufont[] = "monospace:size=10";
|
||||||
|
static const char col_gray1[] = "#222222";
|
|
@ -3,11 +3,15 @@
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const unsigned int borderpx = 3; /* border pixel of windows */
|
static const unsigned int borderpx = 3; /* border pixel of windows */
|
||||||
static const unsigned int gappx = 10; /* gaps between windows */
|
static const unsigned int gappx = 10; /* gaps between windows */
|
||||||
static const unsigned int baralpha = 0xd0;
|
static const unsigned int baralpha = 0xA0;
|
||||||
static const unsigned int borderalpha = OPAQUE;
|
static const unsigned int borderalpha = OPAQUE;
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
static const int vertpad = 8; /* vertical padding of bar */
|
||||||
|
static const int sidepad = 5; /* horizontal padding of bar */
|
||||||
|
static const int horizpadbar = 0; /* horizontal padding for statusbar */
|
||||||
|
static const int vertpadbar = 9; /* vertical padding for statusbar */
|
||||||
static const char *fonts[] = { "Hack:size=13" };
|
static const char *fonts[] = { "Hack:size=13" };
|
||||||
static const char dmenufont[] = "Hack:size=13";
|
static const char dmenufont[] = "Hack:size=13";
|
||||||
static const char col_gray1[] = "#222222";
|
static const char col_gray1[] = "#222222";
|
||||||
|
@ -35,8 +39,7 @@ static const Rule rules[] = {
|
||||||
* WM_NAME(STRING) = title
|
* WM_NAME(STRING) = title
|
||||||
*/
|
*/
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
{ "a", NULL, NULL, 0, 1, -1 }
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
|
|
Binary file not shown.
|
@ -247,6 +247,8 @@ static int screen;
|
||||||
static int sw, sh; /* X display screen geometry width, height */
|
static int sw, sh; /* X display screen geometry width, height */
|
||||||
static int bh; /* bar height */
|
static int bh; /* bar height */
|
||||||
static int lrpad; /* sum of left and right padding for text */
|
static int lrpad; /* sum of left and right padding for text */
|
||||||
|
static int vp; /* vertical padding for bar */
|
||||||
|
static int sp; /* side padding for bar */
|
||||||
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||||
static unsigned int numlockmask = 0;
|
static unsigned int numlockmask = 0;
|
||||||
static void (*handler[LASTEvent]) (XEvent *) = {
|
static void (*handler[LASTEvent]) (XEvent *) = {
|
||||||
|
@ -581,7 +583,7 @@ configurenotify(XEvent *e)
|
||||||
for (c = m->clients; c; c = c->next)
|
for (c = m->clients; c; c = c->next)
|
||||||
if (c->isfullscreen)
|
if (c->isfullscreen)
|
||||||
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
||||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
XMoveResizeWindow(dpy, m->barwin, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh);
|
||||||
}
|
}
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
|
@ -722,8 +724,8 @@ drawbar(Monitor *m)
|
||||||
/* draw status first so it can be overdrawn by tags later */
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
if (m == selmon) { /* status is only drawn on selected monitor */
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
tw = TEXTW(stext);
|
||||||
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
|
drw_text(drw, m->ww - tw, 0, tw, bh, lrpad / 2, stext, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c = m->clients; c; c = c->next) {
|
for (c = m->clients; c; c = c->next) {
|
||||||
|
@ -749,12 +751,12 @@ drawbar(Monitor *m)
|
||||||
if ((w = m->ww - tw - x) > bh) {
|
if ((w = m->ww - tw - x) > bh) {
|
||||||
if (m->sel) {
|
if (m->sel) {
|
||||||
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
drw_text(drw, x, 0, w - 2 * sp, bh, lrpad / 2, m->sel->name, 0);
|
||||||
if (m->sel->isfloating)
|
if (m->sel->isfloating)
|
||||||
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
|
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
|
||||||
} else {
|
} else {
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
drw_rect(drw, x, 0, w - 2 * sp, bh, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
|
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
|
||||||
|
@ -1577,9 +1579,12 @@ setup(void)
|
||||||
drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
|
drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
|
||||||
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
||||||
die("no fonts could be loaded.");
|
die("no fonts could be loaded.");
|
||||||
lrpad = drw->fonts->h;
|
lrpad = drw->fonts->h + horizpadbar;
|
||||||
bh = drw->fonts->h + 2;
|
bh = drw->fonts->h + vertpadbar;
|
||||||
|
sp = sidepad;
|
||||||
|
vp = (topbar == 1) ? vertpad : - vertpad;
|
||||||
updategeom();
|
updategeom();
|
||||||
|
|
||||||
/* init atoms */
|
/* init atoms */
|
||||||
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
|
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
|
||||||
wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
||||||
|
@ -1733,7 +1738,7 @@ togglebar(const Arg *arg)
|
||||||
{
|
{
|
||||||
selmon->showbar = !selmon->showbar;
|
selmon->showbar = !selmon->showbar;
|
||||||
updatebarpos(selmon);
|
updatebarpos(selmon);
|
||||||
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1846,7 +1851,7 @@ updatebars(void)
|
||||||
for (m = mons; m; m = m->next) {
|
for (m = mons; m; m = m->next) {
|
||||||
if (m->barwin)
|
if (m->barwin)
|
||||||
continue;
|
continue;
|
||||||
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth,
|
m->barwin = XCreateWindow(dpy, root, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh, 0, depth,
|
||||||
InputOutput, visual,
|
InputOutput, visual,
|
||||||
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
|
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
|
||||||
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||||
|
@ -1861,11 +1866,11 @@ updatebarpos(Monitor *m)
|
||||||
m->wy = m->my;
|
m->wy = m->my;
|
||||||
m->wh = m->mh;
|
m->wh = m->mh;
|
||||||
if (m->showbar) {
|
if (m->showbar) {
|
||||||
m->wh -= bh;
|
m->wh = m->wh - vertpad - bh;
|
||||||
m->by = m->topbar ? m->wy : m->wy + m->wh;
|
m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad;
|
||||||
m->wy = m->topbar ? m->wy + bh : m->wy;
|
m->wy = m->topbar ? m->wy + bh + vp : m->wy;
|
||||||
} else
|
} else
|
||||||
m->by = -bh;
|
m->by = -bh - vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -57,6 +57,8 @@
|
||||||
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
||||||
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||||
|
|
||||||
|
#define OPAQUE 0xffU
|
||||||
|
|
||||||
/* enums */
|
/* enums */
|
||||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||||
|
@ -235,6 +237,7 @@ static Monitor *wintomon(Window w);
|
||||||
static int xerror(Display *dpy, XErrorEvent *ee);
|
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||||
static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
||||||
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
||||||
|
static void xinitvisual();
|
||||||
static void zoom(const Arg *arg);
|
static void zoom(const Arg *arg);
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
|
@ -244,6 +247,8 @@ static int screen;
|
||||||
static int sw, sh; /* X display screen geometry width, height */
|
static int sw, sh; /* X display screen geometry width, height */
|
||||||
static int bh; /* bar height */
|
static int bh; /* bar height */
|
||||||
static int lrpad; /* sum of left and right padding for text */
|
static int lrpad; /* sum of left and right padding for text */
|
||||||
|
static int vp; /* vertical padding for bar */
|
||||||
|
static int sp; /* side padding for bar */
|
||||||
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||||
static unsigned int numlockmask = 0;
|
static unsigned int numlockmask = 0;
|
||||||
static void (*handler[LASTEvent]) (XEvent *) = {
|
static void (*handler[LASTEvent]) (XEvent *) = {
|
||||||
|
@ -271,6 +276,11 @@ static Drw *drw;
|
||||||
static Monitor *mons, *selmon;
|
static Monitor *mons, *selmon;
|
||||||
static Window root, wmcheckwin;
|
static Window root, wmcheckwin;
|
||||||
|
|
||||||
|
static int useargb = 0;
|
||||||
|
static Visual *visual;
|
||||||
|
static int depth;
|
||||||
|
static Colormap cmap;
|
||||||
|
|
||||||
/* configuration, allows nested code to access above variables */
|
/* configuration, allows nested code to access above variables */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
@ -573,7 +583,7 @@ configurenotify(XEvent *e)
|
||||||
for (c = m->clients; c; c = c->next)
|
for (c = m->clients; c; c = c->next)
|
||||||
if (c->isfullscreen)
|
if (c->isfullscreen)
|
||||||
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
||||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
XMoveResizeWindow(dpy, m->barwin, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh);
|
||||||
}
|
}
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
|
@ -715,7 +725,7 @@ drawbar(Monitor *m)
|
||||||
if (m == selmon) { /* status is only drawn on selected monitor */
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
||||||
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
|
drw_text(drw, m->ww - tw - 2 * sp, 0, tw, bh, 0, stext, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c = m->clients; c; c = c->next) {
|
for (c = m->clients; c; c = c->next) {
|
||||||
|
@ -741,12 +751,12 @@ drawbar(Monitor *m)
|
||||||
if ((w = m->ww - tw - x) > bh) {
|
if ((w = m->ww - tw - x) > bh) {
|
||||||
if (m->sel) {
|
if (m->sel) {
|
||||||
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
drw_text(drw, x, 0, w - 2 * sp, bh, lrpad / 2, m->sel->name, 0);
|
||||||
if (m->sel->isfloating)
|
if (m->sel->isfloating)
|
||||||
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
|
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
|
||||||
} else {
|
} else {
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
drw_rect(drw, x, 0, w - 2 * sp, bh, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
|
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
|
||||||
|
@ -1565,12 +1575,16 @@ setup(void)
|
||||||
sw = DisplayWidth(dpy, screen);
|
sw = DisplayWidth(dpy, screen);
|
||||||
sh = DisplayHeight(dpy, screen);
|
sh = DisplayHeight(dpy, screen);
|
||||||
root = RootWindow(dpy, screen);
|
root = RootWindow(dpy, screen);
|
||||||
drw = drw_create(dpy, screen, root, sw, sh);
|
xinitvisual();
|
||||||
|
drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
|
||||||
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
||||||
die("no fonts could be loaded.");
|
die("no fonts could be loaded.");
|
||||||
lrpad = drw->fonts->h;
|
lrpad = drw->fonts->h;
|
||||||
bh = drw->fonts->h + 2;
|
bh = drw->fonts->h + 2;
|
||||||
|
sp = sidepad;
|
||||||
|
vp = (topbar == 1) ? vertpad : - vertpad;
|
||||||
updategeom();
|
updategeom();
|
||||||
|
|
||||||
/* init atoms */
|
/* init atoms */
|
||||||
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
|
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
|
||||||
wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
||||||
|
@ -1593,7 +1607,7 @@ setup(void)
|
||||||
/* init appearance */
|
/* init appearance */
|
||||||
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
|
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
|
||||||
for (i = 0; i < LENGTH(colors); i++)
|
for (i = 0; i < LENGTH(colors); i++)
|
||||||
scheme[i] = drw_scm_create(drw, colors[i], 3);
|
scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
|
||||||
/* init bars */
|
/* init bars */
|
||||||
updatebars();
|
updatebars();
|
||||||
updatestatus();
|
updatestatus();
|
||||||
|
@ -1724,7 +1738,7 @@ togglebar(const Arg *arg)
|
||||||
{
|
{
|
||||||
selmon->showbar = !selmon->showbar;
|
selmon->showbar = !selmon->showbar;
|
||||||
updatebarpos(selmon);
|
updatebarpos(selmon);
|
||||||
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1828,16 +1842,18 @@ updatebars(void)
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
XSetWindowAttributes wa = {
|
XSetWindowAttributes wa = {
|
||||||
.override_redirect = True,
|
.override_redirect = True,
|
||||||
.background_pixmap = ParentRelative,
|
.background_pixel = 0,
|
||||||
|
.border_pixel = 0,
|
||||||
|
.colormap = cmap,
|
||||||
.event_mask = ButtonPressMask|ExposureMask
|
.event_mask = ButtonPressMask|ExposureMask
|
||||||
};
|
};
|
||||||
XClassHint ch = {"dwm", "dwm"};
|
XClassHint ch = {"dwm", "dwm"};
|
||||||
for (m = mons; m; m = m->next) {
|
for (m = mons; m; m = m->next) {
|
||||||
if (m->barwin)
|
if (m->barwin)
|
||||||
continue;
|
continue;
|
||||||
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
m->barwin = XCreateWindow(dpy, root, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh, 0, depth,
|
||||||
CopyFromParent, DefaultVisual(dpy, screen),
|
InputOutput, visual,
|
||||||
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
|
||||||
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||||
XMapRaised(dpy, m->barwin);
|
XMapRaised(dpy, m->barwin);
|
||||||
XSetClassHint(dpy, m->barwin, &ch);
|
XSetClassHint(dpy, m->barwin, &ch);
|
||||||
|
@ -1850,11 +1866,11 @@ updatebarpos(Monitor *m)
|
||||||
m->wy = m->my;
|
m->wy = m->my;
|
||||||
m->wh = m->mh;
|
m->wh = m->mh;
|
||||||
if (m->showbar) {
|
if (m->showbar) {
|
||||||
m->wh -= bh;
|
m->wh = m->wh - vertpad - bh;
|
||||||
m->by = m->topbar ? m->wy : m->wy + m->wh;
|
m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad;
|
||||||
m->wy = m->topbar ? m->wy + bh : m->wy;
|
m->wy = m->topbar ? m->wy + bh + vp : m->wy;
|
||||||
} else
|
} else
|
||||||
m->by = -bh;
|
m->by = -bh - vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2135,6 +2151,43 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xinitvisual()
|
||||||
|
{
|
||||||
|
XVisualInfo *infos;
|
||||||
|
XRenderPictFormat *fmt;
|
||||||
|
int nitems;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
XVisualInfo tpl = {
|
||||||
|
.screen = screen,
|
||||||
|
.depth = 32,
|
||||||
|
.class = TrueColor
|
||||||
|
};
|
||||||
|
long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
|
||||||
|
|
||||||
|
infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
|
||||||
|
visual = NULL;
|
||||||
|
for(i = 0; i < nitems; i ++) {
|
||||||
|
fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
|
||||||
|
if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
|
||||||
|
visual = infos[i].visual;
|
||||||
|
depth = infos[i].depth;
|
||||||
|
cmap = XCreateColormap(dpy, root, visual, AllocNone);
|
||||||
|
useargb = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
XFree(infos);
|
||||||
|
|
||||||
|
if (! visual) {
|
||||||
|
visual = DefaultVisual(dpy, screen);
|
||||||
|
depth = DefaultDepth(dpy, screen);
|
||||||
|
cmap = DefaultColormap(dpy, screen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zoom(const Arg *arg)
|
zoom(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
|
24
suckless/dwm/dwm.c.rej
Normal file
24
suckless/dwm/dwm.c.rej
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
--- dwm.c
|
||||||
|
+++ dwm.c
|
||||||
|
@@ -708,8 +708,8 @@ drawbar(Monitor *m)
|
||||||
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
||||||
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
|
- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
||||||
|
- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
|
||||||
|
+ tw = TEXTW(stext);
|
||||||
|
+ drw_text(drw, m->ww - tw, 0, tw, bh, lrpad / 2, stext, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (c = m->clients; c; c = c->next) {
|
||||||
|
@@ -1548,8 +1548,8 @@ setup(void)
|
||||||
|
drw = drw_create(dpy, screen, root, sw, sh);
|
||||||
|
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
||||||
|
die("no fonts could be loaded.");
|
||||||
|
- lrpad = drw->fonts->h;
|
||||||
|
- bh = drw->fonts->h + 2;
|
||||||
|
+ lrpad = drw->fonts->h + horizpadbar;
|
||||||
|
+ bh = drw->fonts->h + vertpadbar;
|
||||||
|
updategeom();
|
||||||
|
/* init atoms */
|
||||||
|
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
|
Binary file not shown.
Loading…
Add table
Reference in a new issue