Program got turned off seconds after startup by bash script

I am having this script to turn on some programs at startup


# programs
function startProgs() {
    for value in "${arr[@]}"
        #run without output
        $value > /dev/null 2>&1 & 

    "ibus-daemon -drx"
startProgs "${progArr[@]}"

And script is set up in setting here

While the script did turn on these programs at startup, they only last for seconds before getting turned off. Note that if i run the script normally from terminal, they worked just fine.

What should I do to prevent them from being off like so?

Thank you in advance


  • Desktop KDE Plasma

KDE is probably not finished their session-start, when the script gets run, so you could implement a delay of time before starting it, or a condition to be met (like after x or y is loaded), before starting the script.

Does it need a “&” and a may be disown? after the script finishes, then all started processes will terminate.

startProgs "${progArr[@]}& disown"

@anon11595408 , @xircon I tried both approaches and seems only delaying for a bit time worked for me.

Thanks u both for the help :smiley:


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.