Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8836579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:31:43+00:00 2026-06-14T09:31:43+00:00

By default in dwm config.h provide one keybinding per layout. { MODKEY, XK_t, setlayout,

  • 0

By default in dwm config.h provide one keybinding per layout.

{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },

I want to obtain function in my dwm config which will change acceptable layouts in circle manner.

Something like this:

static void circlesetlayout (const Arg *arg);
...
{ MODKEY, XK_space,  circlesetlayout, {0} },
...
void
circlesetlayout (const Arg *arg) {
  Arg finallayout;
  if (Monitor.sellt == 2) {
    finallayout.v = &layouts[0];
  } else {
    finallayout.v = &layouts[1];
  }
  setlayout (&finallayout);
}

But it doesn’t work in manner I expect.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:31:44+00:00Added an answer on June 14, 2026 at 9:31 am

    This worked for me:

    void
    setnextlayout(const Arg *arg) {
        Arg newarg = {0};
    
        size_t i = 0;
        while(i < LENGTH(layouts) && selmon->lt[selmon->sellt] != &layouts[i])
            i++;
    
        newarg.v = &layouts[(i + 1) % LENGTH(layouts)]; // you can do it without '%'
        setlayout(&newarg);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

By default, there are 5 bands that android provide in its Equalizer class. I
Default ASP.NET MVC project has one MapRoute like routes.MapRoute( Default, {controller}/, new { controller
default date format in DatePicker is yyyy-mm-dd but i need dd-mm-yyyy. This one solution
Default JVM uses maximum 1.5 GB RAM/JVM Java application. But my Server have 8
The default markdown syntax for code blocks is indented by 4 spaces on each
By default, the ordered list looks like this: There are some spacing on the
By default pip installs editable packages into src subdirectory of the directory where Python
The default strongly-typed Edit page in ASP.NET MVC 3 generally exposes all fields for
The default behaviour in browsers is to select the next form element. I want
By default, the Requests python library writes log messages to the console, along the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.