LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Starting programs on login? (https://www.linuxquestions.org/questions/linux-software-2/starting-programs-on-login-82517/)

jenna_h 08-16-2003 09:17 AM

Starting programs on login?
 
Hi, I was wondering if anyone knows how I can start a command after my window manager starts. I use enlightenment 0.16, which usually allows you to click an option in the window menu to start a program on login. However, I would like to be able to do this with background processes (for example, index the database as soon as I login, so I can see its progress on my gkrellm). I use Mandrake 9.1, is there a configuration file somewhere in my home directory that I can use?

mcleodnine 08-16-2003 11:42 AM

You could add the command(s) to index your db in ~/.profile (/home/username/.profile) but this would cause the indexing process to run each time you login (including new xconsole sessions). If you want it to happen when you boot the machine you could add the command(s) to your /etc/rc.d/rc.local

Mega Man X 08-16-2003 11:52 AM

Hi!!!

hmmmmm, it depends how you login. Is it graphical or text mode?. I use blackbox and text login. Anyway, you most likely have to change the file Xclients or xinitrc( depending which interface you login) located at /etc/X11/xinit. Here is mine Xclients for you to have an idea:

if [ -n "$PREFERRED" ] && which $PREFERRED >/dev/null 2>&1; then
PREFERRED=`which $PREFERRED`
xgamma -gamma 1.7
exec $PREFERRED &
exec gkrellm &
exec bbkeys -iconic


Basically, you have to type exec <program you want to start> right after you find the line which initialize your desktop (in my case, PREFERRED as you can see).

Remember to also add an "&" (AND character) at the end of every line which has another program to autostart. More examples:

if [ -n "$PREFERRED" ] && which $PREFERRED >/dev/null 2>&1; then
PREFERRED=`which $PREFERRED`
xgamma -gamma 1.7
exec $PREFERRED &
exec gkrellm &
exec bbkeys -iconic &
exec aterm &
exec gaim

Note that, in the last program that I initialize, I don't use an AND character. If you do so, there will be nothing more to start and will make your X fail. Sorry if it sounds confuse, I am not good at explaining things :)

Good luck though ;)


All times are GMT -5. The time now is 10:07 AM.