2022-07-19 19:45:11 +02:00
|
|
|
-- ██████╗ ██╗ ██╗██╗ ███████╗███████╗
|
|
|
|
-- ██╔══██╗██║ ██║██║ ██╔════╝██╔════╝
|
|
|
|
-- ██████╔╝██║ ██║██║ █████╗ ███████╗
|
|
|
|
-- ██╔══██╗██║ ██║██║ ██╔══╝ ╚════██║
|
|
|
|
-- ██║ ██║╚██████╔╝███████╗███████╗███████║
|
|
|
|
-- ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝
|
|
|
|
|
|
|
|
-- ===================================================================
|
|
|
|
-- Initialization
|
|
|
|
-- ===================================================================
|
|
|
|
|
|
|
|
|
|
|
|
local awful = require("awful")
|
|
|
|
local beautiful = require("beautiful")
|
|
|
|
|
|
|
|
-- define screen height and width
|
|
|
|
local screen_height = awful.screen.focused().geometry.height
|
|
|
|
local screen_width = awful.screen.focused().geometry.width
|
|
|
|
|
|
|
|
-- define module table
|
|
|
|
local rules = {}
|
|
|
|
|
|
|
|
|
|
|
|
-- ===================================================================
|
|
|
|
-- Rules
|
|
|
|
-- ===================================================================
|
|
|
|
|
|
|
|
|
|
|
|
-- return a table of client rules including provided keys / buttons
|
|
|
|
function rules.create(clientkeys, clientbuttons)
|
2022-07-23 19:31:38 +02:00
|
|
|
return {
|
|
|
|
-- All clients will match this rule.
|
|
|
|
{
|
|
|
|
rule = {},
|
|
|
|
properties = {
|
|
|
|
titlebars_enabled = beautiful.titlebars_enabled,
|
|
|
|
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,
|
2022-08-25 14:33:10 +02:00
|
|
|
placement = awful.placement.centered,
|
|
|
|
size_hints_honor = false
|
2022-07-19 19:45:11 +02:00
|
|
|
},
|
2022-07-23 19:31:38 +02:00
|
|
|
},
|
|
|
|
-- Floating clients.
|
|
|
|
{
|
|
|
|
rule_any = {
|
|
|
|
name = {
|
|
|
|
"Steam Guard - Computer Authorization Required"
|
|
|
|
},
|
|
|
|
role = {
|
|
|
|
"pop-up",
|
|
|
|
"GtkFileChooserDialog"
|
|
|
|
},
|
|
|
|
type = {
|
|
|
|
"dialog"
|
|
|
|
}
|
|
|
|
}, properties = {floating = true}
|
|
|
|
},
|
2022-07-19 19:45:11 +02:00
|
|
|
|
2022-07-23 19:31:38 +02:00
|
|
|
-- File chooser dialog
|
|
|
|
{
|
|
|
|
rule_any = {role = {"GtkFileChooserDialog"}},
|
|
|
|
properties = {floating = true, width = screen_width * 0.55, height = screen_height * 0.65}
|
|
|
|
},
|
|
|
|
}
|
2022-07-19 19:45:11 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- return module table
|
|
|
|
return rules
|