views:

172

answers:

2

Edited: How do I programmatically add programs to launch on user session startup on Ubuntu?

I know how to perform this operation through Nautilus but I'd like to know how do this through a script.

+3  A: 

Here ya go: The Freedesktop Autostart specification. It's just a matter of writing a .desktop file to the appropriate place.

Avdi
perfect... thanks!
jldupont
A: 

If you want some program to start with X you could try appending entries to the .xinitrc file, where each entry is something you want to execute with an ampersand (&) attached to it. That's user specific. You can also do something that's specific to your window manager. I use fluxbox so that would be in the ~/.fluxbox/startup file, which is also user specific. I don't know how it works with Gnome, but hopefully the .xinitrc idea will.

If it's just for your purposes you can also make a script called "startup" in your home directory and then add it to the startup programs via the menu, and then have your other script write to this script.

J. Polak