-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotifications.lua
More file actions
55 lines (47 loc) · 1.63 KB
/
notifications.lua
File metadata and controls
55 lines (47 loc) · 1.63 KB
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
local beautiful = require("beautiful")
local naughty = require("naughty")
local ruled = require("ruled")
local awful = require("awful")
local menubar = require("menubar")
ruled.notification.connect_signal("request::rules", function()
-- All notifications will match this rule.
ruled.notification.append_rule {
rule = { },
properties = {
screen = awful.screen.preferred,
implicit_timeout = 5,
}
}
-- Add a red background for urgent notifications.
ruled.notification.append_rule {
rule = { urgency = "critical" },
properties = { fg = "#FF0000", timeout = 0 }
}
ruled.notification.append_rule {
rule = { urgency = "normal" },
properties = {
fg = beautiful.notification_fg,
border_width = beautiful.notification_border_width,
}
}
end)
-- TODO how do I make this work to skip songs for spotify
--naughty.connect_signal("property::selected", function(n)
-- naughty.notification { title = "DEBUG", message = " " .. n}
--end)
naughty.connect_signal("request::display", function(n)
naughty.layout.box { notification = n }
end)
naughty.connect_signal("request::action_icon", function(a, context, hints)
-- use the XDG icon
a.icon = menubar.utils.lookup_icon(hints.id)
end)
naughty.connect_signal("request::icon", function(n, context, hints)
if context ~= "app_icon" then return end
local path = menubar.utils.lookup_icon(hints.app_icon) or
-- use the XDG icon
menubar.utils.lookup_icon(hints.app_icon:lower())
if path then
n.icon = path
end
end)