2023-04-20 04:08:44 +00:00
|
|
|
-- Standard awesome library
|
|
|
|
local awful = require("awful")
|
|
|
|
-- Theme handling library
|
|
|
|
local beautiful = require("beautiful")
|
|
|
|
|
|
|
|
local _M = {}
|
|
|
|
|
|
|
|
-- reading
|
|
|
|
-- https://awesomewm.org/apidoc/libraries/awful.rules.html
|
|
|
|
|
|
|
|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
|
|
|
|
|
|
|
function _M.get(clientkeys, clientbuttons)
|
|
|
|
local rules = {
|
|
|
|
|
|
|
|
-- All clients will match this rule.
|
|
|
|
{ rule = { },
|
|
|
|
properties = {
|
|
|
|
border_width = beautiful.border_width,
|
|
|
|
border_color = beautiful.border_normal,
|
|
|
|
focus = awful.client.focus.filter,
|
|
|
|
raise = true,
|
|
|
|
keys = clientkeys,
|
|
|
|
buttons = clientbuttons,
|
|
|
|
screen = awful.screen.preferred,
|
|
|
|
placement = awful.placement.no_overlap+awful.placement.no_offscreen
|
2023-05-12 08:07:32 +00:00
|
|
|
},
|
2023-04-20 04:08:44 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Floating clients.
|
|
|
|
{ rule_any = {
|
|
|
|
instance = {
|
|
|
|
"copyq", -- Includes session name in class.
|
2023-05-12 08:07:32 +00:00
|
|
|
"pinentry"
|
2023-04-20 04:08:44 +00:00
|
|
|
},
|
|
|
|
class = {
|
|
|
|
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
|
2023-05-01 23:51:42 +00:00
|
|
|
"steamwebhelper",
|
2023-05-12 08:07:32 +00:00
|
|
|
"mate-calc",
|
|
|
|
"steam_app_2060480",
|
|
|
|
"Alacritty",
|
|
|
|
"discord",
|
|
|
|
"Spotify"
|
2023-05-01 23:51:42 +00:00
|
|
|
},
|
2023-04-20 04:08:44 +00:00
|
|
|
|
|
|
|
-- 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.
|
|
|
|
name = {
|
2023-05-01 23:51:42 +00:00
|
|
|
"Friends List",
|
2023-04-23 01:32:15 +00:00
|
|
|
"infinitefusion", -- Pokémon Infinite Fusion
|
2023-05-12 08:07:32 +00:00
|
|
|
"Picture-in-picture",
|
|
|
|
"review files to import", -- Hydrus import window
|
|
|
|
"Spotify"
|
2023-04-20 04:08:44 +00:00
|
|
|
},
|
|
|
|
role = {
|
|
|
|
"AlarmWindow", -- Thunderbird's calendar.
|
|
|
|
"ConfigManager", -- Thunderbird's about:config.
|
|
|
|
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
|
|
|
|
}
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
floating = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Add titlebars to normal clients and dialogs
|
|
|
|
{ rule_any = {
|
|
|
|
type = { "normal", "dialog" }
|
|
|
|
},
|
|
|
|
properties = {
|
|
|
|
titlebars_enabled = false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Set Firefox to always map on the tag named "2" on screen 1.
|
|
|
|
-- { rule = { class = "Firefox" },
|
|
|
|
-- properties = { screen = 1, tag = "2" } },
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return rules
|
|
|
|
end
|
|
|
|
|
|
|
|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
|
|
|
|
|
|
|
return setmetatable({}, { __call = function(_, ...) return _M.get(...) end })
|