how to add session start-up program
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.
Here ya go: The Freedesktop Autostart specification. It's just a matter of writing a .desktop file to the appropriate place.
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.
精彩评论