mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-23 10:18:34 +02:00
load: display a naughty notification when an error occurs on file loading
This commit is contained in:
parent
fa7d139a30
commit
b5c655050d
1 changed files with 5 additions and 0 deletions
5
rc.lua
5
rc.lua
|
@ -11,6 +11,11 @@ function loadrc(name)
|
||||||
local path = awful.util.getdir("config") .. "/rc/" .. name .. ".lua"
|
local path = awful.util.getdir("config") .. "/rc/" .. name .. ".lua"
|
||||||
success, result = pcall(function() return dofile(path) end)
|
success, result = pcall(function() return dofile(path) end)
|
||||||
if not success then
|
if not success then
|
||||||
|
naughty.notify({ title = "Error while loading an RC file",
|
||||||
|
text = "When loading `" .. name ..
|
||||||
|
"`, got the following error:\n" .. result,
|
||||||
|
preset = naughty.config.presets.critical
|
||||||
|
})
|
||||||
return print("E: error loading RC file '" .. name .. "': " .. result)
|
return print("E: error loading RC file '" .. name .. "': " .. result)
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue