Disable application from autostarting

One of my apps writes itself to autostart every time I launch it. How to disable it while I need other apps successfully use autostart? In KDE it’s System settings - Startup and Shutdown - Autostart.

I found an answer for Gnome:

To disable autostart of skype for a particular user use following steps:

1. Start shell (terminal or konsole) as corresponding user
2. Edit '~/.config/autostart/skypeforlinux.desktop' and set

X-GNOME-Autostart-enabled=false

3. Logout and login again to test

Sorry, but what is the question?

Why do you not simply name that program? Maybe then someone says: Oh, that program … (I once found that e.g. Microsoft Teams has that bad habit).

Is there a configuration file for the application somewhere unexpected?

  • Meaning, not in the default User location ‘~/.config/’ …
    Could possibly be in ‘~/.local/share/’ …
    Or, in ‘~/.kde4/’ …

It’s rarely known Outline VPN.

DIdn’t find anything specific. But I broke the file in ~/.config/autostart/ and it stopped to autostart even if it has a presence in the list.

Hm, it rewrote its file, so, need to block permissions.

Then then is most probably not a KDE application, thus sercahing in places like ~/.kde is then rather useless

Could result in errors messages thrown by the program. Or even worse, it exiting after giving an error.

Changing things hard builtin by the developers is not easy apart from changing the source :wink:

We still do not know what application it is (Outline VPN is too vague, there are multiple programs), but assuming that it is client package - it enables autostart when user starts VPN connection and disables autostart when user stops VPN connection (and I can follow this logic). So may be the solution would be to stop VPN before logging out/shutting down.

Well, one could run program in separate mount namespace and mount ~/.config/autostart on a temporary directory. bubblewrap is provided by Leap, so

bor@10:~> ll .config/autostart/
total 8
-r--r--r-- 1 bor users 850 Jul  6  2020 org.opensuse.opensuse_welcome.desktop
-rw-r--r-- 1 bor users 203 Jun 21  2022 Turn X11 screen saver off.desktop
bor@10:~> mkdir /run/user/1000/test
bor@10:~> bwrap --bind /lib64 /lib64 --bind /usr /usr --bind /home /home --bind  /run/user/1000/test $PWD/.config/autostart -- /usr/bin/bash
bash-4.4$ ls -l .config/autostart
total 0
bash-4.4$ exit
bor@10:~> 

This is just an example, one would need more bind mounts if the goal is not sandboxing. Actually, all directories under / should be listed. Advantage is that you could mount them read-only so restrict access from large complex program like vpn manager.

This one

I think to add to autostart a script that deletes this app’s file. But this hack is really a hack.

It’s a know Outline VPN problem: