How can I start a program/script as root as soon as GDM starts. I need the said program/script to start even before the user has logged in. It needs to start as soon as the GDM login screen shows up.

I know that putting something in /etc/xdg/autostart starts the program/script on user login. Where do I put my script to have it start before user login?

1 Answer 1


Figured it out. Putting the .desktop file under /usr/share/gdm/greeter/autostart/ will start the program/script when gdm loads the login screen (before actual user login).

But this has some strings attached, for instance, dconf-service isn't loaded until the user logs in so libdconf won't be able to read anything. This holds true even after the user logs in since dconf-service loads under the logged in session.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .