Sunday, June 10, 2007

How to Add Startup Programs (Linux & FreeBSD)


This applies to different desktop managers (XDM, GDM, and KDM)

newemachine$ vi ~/.xsession

then put your commands to the following in the file

#!/bin/sh
gnome-terminal &
exec /usr/bin/gnome-session

This runs gnome-terminal after you log into a Gnome session. You can substitute 'gnome-terminal' with other commands that you want to run. 'exec /usr/bin/gnome-session' is required here; otherwise, as soon as starting gnome-terminal process finishes, you will be taken back to the log in window. The directory of window managers such as Gnome varies from distribution to distribution. If you run a different window manager, you want to change '/usr/bin/gnome-session' accordingly.
newemachine$ chmod u+x ~/.xsession
.xsession has to be executable to get this working.

No comments: