Search code examples
luaawesome-wm

How can I show an application on multiple tags in Awesome WM 4.0?


I used to use a rule like this in Awesome WM 3.5:

{
  rule = { class = "wm_kybrd_fcns.py" },
  properties = { floating = true },
  callback = function (c)
    c:tags({
      tags[1][1],
      tags[1][2],
      tags[1][3],
      tags[1][4],
      tags[1][5]
    })
  end
},

to show this application on all tags, but this no longer works. I looked around, but didn't find a good place that showcased what other people have done with their rc.lua config files in version 4.0.

I tried this:

{
  rule = { class = "wm_kybrd_fcns.py" },
  properties = { floating = true },
  callback = function (c)
    local s = awful.screen.focused()
    c:tags({
      s.tags[1],
      s.tags[2],
      s.tags[3],
      s.tags[4],
      s.tags[5]
    })
  end
},

which worked fine on awesome.restart, but after the next reboot I ended up with garbled icon images all over my wibar particularly in the tags region. That went away when I commented out the new rule.


Solution

  • the next reboot I ended up with garbled icon images all over my wibar particularly in the tags region

    That's usually a bug with some graphics driver. There is a fix in X11 that improves it, but it is too new to be on your computer yet. You can run Awesome with --no-argb or use compton to mitigate the issue.

    Your code should work, however 4.0+ has a simpler version:

    {
      rule = { class = "wm_kybrd_fcns.py" },
      properties = { floating = true },
      screen = awful.screen.focused,
      tags = { "1", "2", "3", "4", "5" }
    },
    

    This is assuming the tag names are numeric, change it to fit you needs.