summaryrefslogtreecommitdiff
path: root/rules.lua
blob: 8655541c119d71e52dc189a5d15ee0ae0a978731 (plain)
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
local awful = require("awful")
local beautiful = require("beautiful")

-- Rules to apply to new clients (through the "manage" signal)
awful.rules.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,
			prevent_kill = false,
		}
	},
	-- Warp cursor
	{
		rule_any = { class = {
			"Chromium-browser",
			"Firefox",
			"Firefox-esr",
			"Gimp",
			"KeePassXC",
			"Pcmanfm",
		}},
		properties = { warp_cursor = true, }
	},
	-- KeePassXC rules
	{
		rule = { class = "KeePassXC" },
		-- except = { name = "Unlock Database - KeePassXC" },  -- Not needed
		properties = {
			new_tag = {
				name     = "KeePassXC",
				layout   = awful.layout.suit.max,
				volatile = true,
			},
			-- callback = function(c) c.first_tag.icon = c.icon end
		}
	},
	{
		rule_any = { name = { "Unlock Database - KeePassXC", "KeePassXC - Browser Access Request" } },
		properties = {
			screen = awful.screen.focused(),
			floating = true,
			placement = awful.placement.centered,
			-- tags = awful.screen.focused().selected_tags,  -- For some reason, this doesn't work
			callback = function(c) c:tags(awful.screen.focused().selected_tags) end  -- But this does
		}
	},
}