我有三个屏幕。一个用于 URxvt 和 VIM,另一个用于 Chromium、Firefox 和 Opera,第三个用于 Chromium 的开发者工具。以下是我在 rc.lua 中创建的规则,旨在创建此行为。如果我已经打开了窗口并重新启动 awesome,则它会起作用,但是当我在 Chromium 中按 Ctrl+Shift+I 启动开发者工具窗口时,开发者工具规则不适用。相反,它会与任何其他新的 Chromium 窗口一样处理,并放置在第一个屏幕上。即使我注释掉 Chromium 规则,开发者工具窗口仍然不受我为其设置的规则的影响,除非我重新启动 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
我设法通过定位窗口角色而不是名称来解决这个问题。我还通过对相同的浏览器规则使用rule_any使规则更加简洁。
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] } }
}