LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2002, 04:38 PM   #1
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Rep: Reputation: 15
Starting program automatically as logging in


Is there a script I can add a command to (or program) so that the program will start whenever I log on?

I've got Kmix in mind- so that I can control the volume all the time.

Thanks
Adam
 
Old 03-13-2002, 07:01 AM   #2
dimonb
LQ Newbie
 
Registered: Mar 2002
Location: Russia
Distribution: SuSE
Posts: 8

Rep: Reputation: 0
if u want to start program when user foo is logged in, u should edit file /home/foo/.bashrc (if bash is foo's default shell, may be /home/foo/.profile will right choice).
if all users should start your script, u should change /etc/profile (in some systems the right way is to change /etc/profile.local. If u find in /etc/profile call of /etc/profile.local, than change /etc/profile.local)
if your script should be started when system starts, then u should edit /etc/rc.d/boot (or /etc/rc.d/boot.local)

but anyway read the doc about how system is started.

it's right to change *.local files because when u choose automatic upgrade of package files /etc/profile, /etc/rc.d/boot would be overwritten.
 
Old 03-13-2002, 07:54 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well kmix is presumably a kde app (*COUGH*gnome*COUGH*) so you need to put it in ~/.xinitrc of ~/.Xclients depending on which one exists already. there's probaly a lame kde way to do it, but that's the hardcoded approach
 
Old 03-13-2002, 08:11 AM   #4
dimonb
LQ Newbie
 
Registered: Mar 2002
Location: Russia
Distribution: SuSE
Posts: 8

Rep: Reputation: 0
hm... in kde, just on exit say "save session" with application u wish to start running and all will be ok
 
Old 03-13-2002, 08:37 AM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
You can also, for KDE, open the directory ~/.kde/Autostart (or whatever it is) and link the program into it. If you're going to be using KDE then I would advise you use this method. I've had KDE getting a bit stroppy when I launch stuff from .xinitrc. Of course, if you're going to be using another WM/DE then use the .xinitrc way. As with all applications, KMix can be run in any WM/DE as long as you have the QT libraries installed (i.e. KDE is installed ).
 
Old 03-13-2002, 11:24 AM   #6
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Original Poster
Rep: Reputation: 15
thanks guys and lasses(?) - will give it a go.
My gllobal profile script sounds the best solution.

Adam
 
Old 03-13-2002, 11:33 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally posted by adcripps
thanks guys and lasses(?) - will give it a go.
My gllobal profile script sounds the best solution.

Adam
the best solution? so you didn't actually bother reading the other replies then??
 
Old 03-13-2002, 12:38 PM   #8
therion12
Member
 
Registered: Dec 2001
Location: chicago, IL
Distribution: Gentoo 1.4_rc1
Posts: 913

Rep: Reputation: 30
If you are using a alternate Window Manager then you can just add the program name to the ~/.xinitrc file above the wm load line. But for kde/gnome all you need to do is go in and choose save session.
 
Old 03-13-2002, 12:47 PM   #9
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
I thought that 'Save Session' was only really to save the state of your current session. If you need to log out quick and you've got konqueror running, then saving the state will ensure that konqueror loads up again when you log back in. For simply having the same program load on startup, this might not be helpful.
 
Old 03-13-2002, 12:47 PM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally posted by therion12
If you are using a alternate Window Manager then you can just add the program name to the ~/.xinitrc file above the wm load line. But for kde/gnome all you need to do is go in and choose save session.
me...
"well kmix is presumably a kde app (*COUGH*gnome*COUGH*) so you need to put it in ~/.xinitrc of ~/.Xclients depending on which one exists already. there's probaly a lame kde way to do it, but that's the hardcoded approach"

dimonb
"hm... in kde, just on exit say "save session" with application u wish to start running and all will be ok"

any particular reason for just plain repeating what people had already said?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MDK 10.0 Logging out automatically NC_Jed Mandriva 5 01-24-2005 01:33 AM
automatically logging into XWindows ironcrouton Linux - Newbie 2 12-16-2004 06:44 AM
automatically logging in? bobbens Debian 2 11-01-2004 05:49 AM
Automatically logging in a user from runlevel 3 VxJasonxV Linux - General 9 02-29-2004 03:25 PM
running a script automatically when Logging out? hamster Linux - General 2 06-03-2003 08:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration