rc.lua: Switch from `awful.rules` to `ruled.client`.
It's the same module, but with a new name. The commit also switches from the "one off" rule write to the incremental and signal based one. This allows modules to add their own rules without having a race condition against `rc.lua` and other modules. Previously, if a module wasn't designed to prevent it, rules got destroyed each time.
This commit is contained in:
parent
8df463f971
commit
b8fbeb95c6
|
@ -13,6 +13,8 @@ local wibox = require("wibox")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
-- Notification library
|
-- Notification library
|
||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
|
-- Declarative object management
|
||||||
|
local ruled = require("ruled")
|
||||||
local menubar = require("menubar")
|
local menubar = require("menubar")
|
||||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||||
-- Enable hotkeys help widget for VIM and other apps
|
-- Enable hotkeys help widget for VIM and other apps
|
||||||
|
@ -439,37 +441,30 @@ end)
|
||||||
-- {{{ Rules
|
-- {{{ Rules
|
||||||
-- Rules to apply to new clients.
|
-- Rules to apply to new clients.
|
||||||
-- @DOC_RULES@
|
-- @DOC_RULES@
|
||||||
awful.rules.rules = {
|
ruled.client.connect_signal("request::rules", function()
|
||||||
-- @DOC_GLOBAL_RULE@
|
-- @DOC_GLOBAL_RULE@
|
||||||
-- All clients will match this rule.
|
-- All clients will match this rule.
|
||||||
{ rule = { },
|
ruled.client.append_rule {
|
||||||
properties = { focus = awful.client.focus.filter,
|
id = "global",
|
||||||
|
rule = { },
|
||||||
|
properties = {
|
||||||
|
focus = awful.client.focus.filter,
|
||||||
raise = true,
|
raise = true,
|
||||||
screen = awful.screen.preferred,
|
screen = awful.screen.preferred,
|
||||||
placement = awful.placement.no_overlap+awful.placement.no_offscreen
|
placement = awful.placement.no_overlap+awful.placement.no_offscreen
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
-- @DOC_FLOATING_RULE@
|
-- @DOC_FLOATING_RULE@
|
||||||
-- Floating clients.
|
-- Floating clients.
|
||||||
{ rule_any = {
|
ruled.client.append_rule {
|
||||||
instance = {
|
id = "floating",
|
||||||
"DTA", -- Firefox addon DownThemAll.
|
rule_any = {
|
||||||
"copyq", -- Includes session name in class.
|
instance = { "copyq", "pinentry" },
|
||||||
"pinentry",
|
|
||||||
},
|
|
||||||
class = {
|
class = {
|
||||||
"Arandr",
|
"Arandr", "Blueman-manager", "Gpick", "Kruler", "Sxiv",
|
||||||
"Blueman-manager",
|
"Tor Browser", "Wpa_gui", "veromix", "xtightvncviewer"
|
||||||
"Gpick",
|
},
|
||||||
"Kruler",
|
|
||||||
"MessageWin", -- kalarm.
|
|
||||||
"Sxiv",
|
|
||||||
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
|
|
||||||
"Wpa_gui",
|
|
||||||
"veromix",
|
|
||||||
"xtightvncviewer"},
|
|
||||||
|
|
||||||
-- Note that the name property shown in xprop might be set slightly after creation of the client
|
-- Note that the name property shown in xprop might be set slightly after creation of the client
|
||||||
-- and the name shown there might not match defined rules here.
|
-- and the name shown there might not match defined rules here.
|
||||||
name = {
|
name = {
|
||||||
|
@ -480,19 +475,26 @@ awful.rules.rules = {
|
||||||
"ConfigManager", -- Thunderbird's about:config.
|
"ConfigManager", -- Thunderbird's about:config.
|
||||||
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
|
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
|
||||||
}
|
}
|
||||||
}, properties = { floating = true }},
|
},
|
||||||
|
properties = { floating = true }
|
||||||
|
}
|
||||||
|
|
||||||
-- @DOC_DIALOG_RULE@
|
-- @DOC_DIALOG_RULE@
|
||||||
-- Add titlebars to normal clients and dialogs
|
-- Add titlebars to normal clients and dialogs
|
||||||
{ rule_any = {type = { "normal", "dialog" }
|
ruled.client.append_rule {
|
||||||
-- @DOC_CSD_TITLEBARS@
|
-- @DOC_CSD_TITLEBARS@
|
||||||
}, properties = { titlebars_enabled = true }
|
id = "titlebars",
|
||||||
},
|
rule_any = { type = { "normal", "dialog" } },
|
||||||
|
properties = { titlebars_enabled = true }
|
||||||
|
}
|
||||||
|
|
||||||
-- Set Firefox to always map on the tag named "2" on screen 1.
|
-- Set Firefox to always map on the tag named "2" on screen 1.
|
||||||
-- { rule = { class = "Firefox" },
|
-- ruled.tag.append_rule {
|
||||||
-- properties = { screen = 1, tag = "2" } },
|
-- rule = { class = "Firefox" },
|
||||||
}
|
-- properties = { screen = 1, tag = "2" }
|
||||||
|
-- }
|
||||||
|
end)
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Titlebars
|
-- {{{ Titlebars
|
||||||
|
|
Loading…
Reference in New Issue