Added notification when autostart process exits

This commit is contained in:
Mutzi 2025-03-18 15:29:17 +01:00
parent 2c30cd770f
commit 9d91ceabcc
Signed by: root
GPG Key ID: 2437494E09F13876

View File

@ -1,5 +1,6 @@
local io = require('io')
local spawn = require('awful').spawn.spawn
local naughty = require('naughty')
local spawn = require('awful').spawn.with_line_callback
local readable = require('gears.filesystem').file_readable
local confdir = require('src.util.path').conf_dir
@ -20,7 +21,15 @@ if readable(autostart_file) then
for line in io.lines(autostart_file, "*l") do
---@cast line string
if line:len() > 0 then
spawn(line)
spawn(line, {
exit = function(reason, code)
naughty.notify {
preset = naughty.config.presets.warn,
title = 'Autostart prcoess exited',
text = 'Process ' .. line .. ' exited because ' .. reason .. ' with code ' .. code
}
end
})
end
end
end