Added notification when autostart process exits
This commit is contained in:
parent
2c30cd770f
commit
9d91ceabcc
@ -1,5 +1,6 @@
|
|||||||
local io = require('io')
|
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 readable = require('gears.filesystem').file_readable
|
||||||
local confdir = require('src.util.path').conf_dir
|
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
|
for line in io.lines(autostart_file, "*l") do
|
||||||
---@cast line string
|
---@cast line string
|
||||||
if line:len() > 0 then
|
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
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user