pdwm
pdwm copied to clipboard
How to apply patches and add functions
Hello, I am trying to use functions which requires selmon to apply it but I don't know how to apply patches in it please guide the functions are // Define the function to shift view void shiftview(const Arg *arg) { Client *c; unsigned int seltags; unsigned int newtags = 0;
seltags = selmon->tagset[selmon->seltags];
if(arg->i > 0) { // left circular shift
newtags = (seltags << arg->i) | (seltags >> (LENGTH(tags) - arg->i));
} else { // right circular shift
newtags = seltags >> (- arg->i) | seltags << (LENGTH(tags) + arg->i);
}
newtags &= TAGMASK;
if (newtags) {
view(&((Arg) { .ui = newtags }));
for (c = selmon->clients; c; c = c->next)
if (c->tags & newtags)
focus(c);
}
}
void movewindowtows(const Arg *arg) { if (!selmon->sel) return; int newtag = selmon->sel->tags; if (arg->i > 0) { newtag = newtag << arg->i; if (newtag > (1 << (LENGTH(tags) - 1))) // Wrap around newtag = 1; } else { newtag = newtag >> (-arg->i); if (newtag < 1) // Wrap around newtag = 1 << (LENGTH(tags) - 1); } selmon->sel->tags = newtag; focus(NULL); arrange(selmon); }