add restart detection to prevent autostart to trigger on restarts

This commit is contained in:
2023-03-29 02:27:14 +02:00
parent e3757c0ef9
commit 61930bf561

View File

@@ -2,7 +2,22 @@ local Gio = require('lgi').Gio
local aspawn = require('awful.spawn') local aspawn = require('awful.spawn')
local gfilesystem = require('gears.filesystem') local gfilesystem = require('gears.filesystem')
local capi = {
awesome = awesome,
}
local function is_restart()
capi.awesome.register_xproperty('is_restart', 'boolean')
local restart_detected = capi.awesome.get_xproperty('is_restart') ~= nil
capi.awesome.set_xproperty('is_restart', true)
return restart_detected
end
return function(table) return function(table)
if is_restart() then return end
for _, t in ipairs(table) do for _, t in ipairs(table) do
aspawn(t); aspawn(t);
end end