mirror of
https://git.sr.ht/~coasteen/dotfiles
synced 2025-11-04 14:47:38 +01:00
Upload files to ".suckless/patch"
This commit is contained in:
parent
b2e9875711
commit
4c06085e0f
5 changed files with 106 additions and 0 deletions
20
.suckless/patch/attachx.c
Normal file
20
.suckless/patch/attachx.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
void
|
||||
attachx(Client *c)
|
||||
{
|
||||
Client *at;
|
||||
|
||||
|
||||
unsigned int n;
|
||||
for (at = c->mon->clients, n = 0; at; at = at->next)
|
||||
if (!at->isfloating && ISVISIBLEONTAG(at, c->tags))
|
||||
if (++n >= c->mon->nmaster)
|
||||
break;
|
||||
|
||||
if (at && c->mon->nmaster) {
|
||||
c->next = at->next;
|
||||
at->next = c;
|
||||
return;
|
||||
}
|
||||
attach(c); // master (default)
|
||||
}
|
||||
|
||||
2
.suckless/patch/attachx.h
Normal file
2
.suckless/patch/attachx.h
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
static void attachx(Client *c);
|
||||
|
||||
39
.suckless/patch/bar.c
Normal file
39
.suckless/patch/bar.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
void
|
||||
barhover(XEvent *e, Bar *bar)
|
||||
{
|
||||
const BarRule *br;
|
||||
Monitor *m = bar->mon;
|
||||
XMotionEvent *ev = &e->xmotion;
|
||||
BarArg barg = { 0, 0, 0, 0 };
|
||||
int r;
|
||||
|
||||
for (r = 0; r < LENGTH(barrules); r++) {
|
||||
br = &barrules[r];
|
||||
if (br->bar != bar->idx || (br->monitor == 'A' && m != selmon) || br->hoverfunc == NULL)
|
||||
continue;
|
||||
if (br->monitor != 'A' && br->monitor != -1 && br->monitor != bar->mon->num)
|
||||
continue;
|
||||
if (bar->x[r] > ev->x || ev->x > bar->x[r] + bar->w[r])
|
||||
continue;
|
||||
|
||||
barg.x = ev->x - bar->x[r];
|
||||
barg.y = ev->y - bar->borderpx;
|
||||
barg.w = bar->w[r];
|
||||
barg.h = bar->bh - 2 * bar->borderpx;
|
||||
|
||||
br->hoverfunc(bar, &barg, ev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Bar *
|
||||
wintobar(Window win)
|
||||
{
|
||||
Monitor *m;
|
||||
Bar *bar;
|
||||
for (m = mons; m; m = m->next)
|
||||
for (bar = m->bar; bar; bar = bar->next)
|
||||
if (bar->win == win)
|
||||
return bar;
|
||||
return NULL;
|
||||
}
|
||||
2
.suckless/patch/bar.h
Normal file
2
.suckless/patch/bar.h
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
static void barhover(XEvent *e, Bar *bar);
|
||||
static Bar *wintobar(Window win);
|
||||
43
.suckless/patch/bar_alpha.c
Normal file
43
.suckless/patch/bar_alpha.c
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
static int useargb = 0;
|
||||
static Visual *visual;
|
||||
static int depth;
|
||||
static Colormap cmap;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Reference in a new issue