Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to apply patches and add functions #33

Open
prateekshukla1108 opened this issue Sep 18, 2024 · 0 comments
Open

How to apply patches and add functions #33

prateekshukla1108 opened this issue Sep 18, 2024 · 0 comments

Comments

@prateekshukla1108
Copy link

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant