-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules.lua
122 lines (107 loc) · 3.71 KB
/
rules.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
-- ██████╗ ██╗ ██╗██╗ ███████╗███████╗
-- ██╔══██╗██║ ██║██║ ██╔════╝██╔════╝
-- ██████╔╝██║ ██║██║ █████╗ ███████╗
-- ██╔══██╗██║ ██║██║ ██╔══╝ ╚════██║
-- ██║ ██║╚██████╔╝███████╗███████╗███████║
-- ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝
-- ===================================================================
-- Imports
-- ===================================================================
local awful = require("awful")
local beautiful = require("beautiful")
local screen_height = awful.screen.focused().geometry.height
local screen_width = awful.screen.focused().geometry.width
--local dpi = beautiful.xresources.apply_dpi
-- define module table
local rules = {}
-- ===================================================================
-- Rules
-- ===================================================================
function rules.create(clientkeys, clientbuttons)
return {
-- 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.centered
},
},
-- Floating clients.
{
rule_any = {
instance = {
"DTA",
"copyq",
},
class = {
"Nm-connection-editor"
},
name = {
"Event Tester",
"Steam Guard - Computer Authorization Required"
},
role = {
"pop-up",
"GtkFileChooserDialog"
},
type = {
"dialog"
}
}, properties = {floating = true}
},
-- Fullscreen clients
{
rule_any = {
instance = {
"gnome-screenshot",
},
class = {
"flatpak run ch.openboard.OpenBoard",
},
}, properties = {fullscreen = true}
},
-- Visualizer
{
rule_any = {name = {"cava"}},
properties = {
floating = true,
maximized_horizontal = true,
sticky = true,
ontop = false,
skip_taskbar = true,
below = true,
focusable = false,
height = screen_height * 0.40,
opacity = 0.6
},
callback = function (c)
decorations.hide(c)
awful.placement.bottom(c)
end
},
-- Rofi
{
rule_any = { name = { "rofi" } },
properties = { maximized = false, ontop = true }
},
-- File chooser dialog
{
rule_any = { role = { "GtkFileChooserDialog" } },
properties = { floating = true, width = screen_width * 0.55, height = screen_height * 0.65 }
},
-- Pavucontrol & Bluetooth Devices
{
rule_any = { class = { "Pavucontrol" }, name = { "Bluetooth Devices" } },
properties = { floating = true, width = screen_width * 0.55, height = screen_height * 0.45 }
},
}
end
-- return module table
return rules