Add an autostart application for all users
To start an application automatically when the user logs in, you need to create a .desktop file for that application in the /etc/xdg/autostart/ directory.
To add an autostart application for all users:
Create a .desktop file in the /etc/xdg/autostart/ directory:
[Desktop Entry] Type=Application Name=Files Exec=nautilus -n OnlyShowIn=GNOME; AutostartCondition=GSettings org.gnome.desktop.background show-desktop-icons
Replace Files with the name of the application.
Replace nautilus -n with the command you wish to use to run the application.
You can use the AutostartCondition key to check for a value of a GSettings key.
The session manager runs the application automatically if the key's value is true. If the key's value changes in the running session, the session manager starts or stops the application, depending on what the previous value for the key was.