-
Notifications
You must be signed in to change notification settings - Fork 239
/
Copy pathnotifications.lua
62 lines (56 loc) · 1.41 KB
/
notifications.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
local naughty = require('naughty')
local beautiful = require('beautiful')
local gears = require('gears')
local dpi = require('beautiful').xresources.apply_dpi
-- Naughty presets
naughty.config.padding = 8
naughty.config.spacing = 8
naughty.config.defaults.timeout = 5
naughty.config.defaults.screen = 1
naughty.config.defaults.position = 'bottom_left'
naughty.config.defaults.margin = dpi(16)
naughty.config.defaults.ontop = true
naughty.config.defaults.font = 'Roboto Regular 10'
naughty.config.defaults.icon = nil
naughty.config.defaults.icon_size = dpi(32)
naughty.config.defaults.shape = gears.shape.rounded_rect
naughty.config.defaults.border_width = 0
naughty.config.defaults.hover_timeout = nil
-- Error handling
if _G.awesome.startup_errors then
naughty.notify(
{
preset = naughty.config.presets.critical,
title = 'Oops, there were errors during startup!',
text = _G.awesome.startup_errors
}
)
end
do
local in_error = false
_G.awesome.connect_signal(
'debug::error',
function(err)
if in_error then
return
end
in_error = true
naughty.notify(
{
preset = naughty.config.presets.critical,
title = 'Oops, an error happened!',
text = tostring(err)
}
)
in_error = false
end
)
end
function log_this(title, txt)
naughty.notify(
{
title = 'log: ' .. title,
text = txt
}
)
end