Created
January 16, 2024 19:11
-
-
Save bpsuntrup/fba85a1f1678167a3449d8ff9d845d5f to your computer and use it in GitHub Desktop.
dwm "cards" layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
cards(Monitor *mon) { | |
unsigned int i, n, nw, nh; | |
Client *c; | |
for(n = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next), n++); | |
if(n == 0) | |
return; | |
nw = mon->ww; | |
nh = mon->wh; | |
unsigned int gap = mon->gap->gappx * 2; /* quirky default, makes this change dependent on gaps */ | |
for(i = 1, c = nexttiled(mon->clients); c; c = nexttiled(c->next)) { | |
resize(c, | |
((n-i) * (gap + c->bw)) + mon->gap->gappx, | |
((n-i) * (gap + c->bw)) + mon->wy + mon->gap->gappx, | |
nw - (n * (gap + c->bw)), | |
nh - (n * (gap + c->bw)), | |
0 | |
); | |
i++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment