Search code examples
awesome-wm

How to set a default nmaster for all tags?


I'm running awesome-wm 3.5.6 and am looking for a way to set the default nmaster for all my tags to zero. The best I can do so far is call awful.tag.setnmaster(0) right after my tags are created in my rc.lua. However, this only sets the nmaster value of the first tag, which actually makes sense reading the documentation I found here.

Is there a single property I can set to set the default nmaster for all my tags, or do I have to loop over them and set the value for each tag separately? In the latter case, some help with writing that loop would be greatly appreciated, as I'm pretty new to both lua and awesome :).

Thanks!


Solution

  • I believe, having taken a look at the code, that it is not possible to a default nmaster by setting a single property (although I would love to be proven wrong).

    So I had to implement a loop and after a bit of trial and error worked out the following, which works:

    tags = {}
    for s = 1, screen.count() do
        -- Each screen has its own tag table.
        tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, awful.layout.suit.tile.bottom)
        for name,tag in pairs(tags[s]) do
            awful.tag.setnmaster(0, tag)
        end
    end