try this
This commit is contained in:
parent
ef3acad0f1
commit
bda8d6440b
1 changed files with 20 additions and 7 deletions
|
@ -592,13 +592,26 @@ local run_on_start_up = {
|
||||||
'keepassxc',
|
'keepassxc',
|
||||||
'flameshot',
|
'flameshot',
|
||||||
}
|
}
|
||||||
|
local startupDone
|
||||||
|
do
|
||||||
|
local restart_detected
|
||||||
|
startupDone = function()
|
||||||
|
-- If we already did restart detection: Just return the result
|
||||||
|
if restart_detected ~= nil then
|
||||||
|
return restart_detected
|
||||||
|
end
|
||||||
|
|
||||||
for _, app in ipairs(run_on_start_up) do
|
-- Register a new boolean
|
||||||
local findme = app
|
awesome.register_xproperty("awesome_startup", "boolean")
|
||||||
local firstspace = app:find(" ")
|
-- Check if this boolean is already set
|
||||||
if firstspace then
|
restart_detected = awesome.get_xproperty("awesome_startup") ~= nil
|
||||||
findme = app:sub(0, firstspace - 1)
|
-- Set it to true
|
||||||
|
awesome.set_xproperty("awesome_startup", true)
|
||||||
|
-- Return the result
|
||||||
|
return restart_detected
|
||||||
end
|
end
|
||||||
-- pipe commands to bash to allow command to be shell agnostic
|
end
|
||||||
awful.spawn.with_shell(string.format("echo 'pgrep -u $USER -x %s > /dev/null || (%s)' | bash -", findme, app), false)
|
|
||||||
|
if not startupDone() then
|
||||||
|
awful.spawn('keepassxc')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue