3

I have three screens. One is for URxvt and VIM, another is for Chromium, Firefox, and Opera, and the third is for Chromium's Developer Tools. Below are the rules I've created in my rc.lua in an attempt to create this behavior. It works if I already have the windows open and I relaunch awesome, but the Developer Tools rule doesn't apply when I hit Ctrl+Shift+I within Chromium to launch the Developer Tools window. Instead, it is treated the same as any other new Chromium window and is placed on the first screen. Even if I comment out the Chromium rule, the Developer Tools window still isn't affected by the rule I setup for it, unless I relaunch awesome.

awful.rules.rules = {
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = awful.client.focus.filter,
                     keys = clientkeys,
                     buttons = clientbuttons } },
    { rule = { class = "URxvt" },
      properties = { tag = tags[2][1],
                     size_hints_honor = false } },
    { rule = { class = "Chromium" },
      properties = { tag = tags[1][1] } },
    { rule = { class = "Firefox" },
      properties = { tag = tags[1][1] } },
    { rule = { class = "Opera" },
      properties = { tag = tags[1][1] } },
    { rule = { name = "Developer Tools" },
      properties = { tag = tags[3][1] } },
}
1
  • 1
    In my case, what happens is that when the client is first created (with ~chrome superuser.com), it's WM_NAME (by xprop) is "Untitled - Google Chrome" rather than what I match it to (say "Super User - Google Chrome"), so the rule somewhat rightly doesn't apply, and a second later when the name is fine, the awesome rules application is already done. I suspect this is also your problem. Jan 23, 2017 at 6:06

1 Answer 1

3

I managed to work around the issue by targeting the windows role instead of the name. I also made the rules more succinct by using rule_any for the identical browser rules.

awful.rules.rules = {
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = awful.client.focus.filter,
                     keys = clientkeys,
                     buttons = clientbuttons } },

    { rule = { class = "URxvt" },
      properties = { tag = tags[2][1],
                     size_hints_honor = false } },

    { rule_any = { class = { "Chromium-browser", "Firefox", "Opera" } },
      properties = { tag = tags[1][1] } },

    { rule = { class = "Chromium-browser", role = "pop-up" },
      properties = { tag = tags[3][1] } }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .