LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 05: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, 08: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, 08:54 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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, 09: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, 09:37 AM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Debian + Ubuntu
Posts: 4,358

Rep: Reputation: 57
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, 12:24 PM   #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, 12:33 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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, 01: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, 01:47 PM   #9
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Debian + Ubuntu
Posts: 4,358

Rep: Reputation: 57
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, 01:47 PM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:33 AM
automatically logging into XWindows ironcrouton Linux - Newbie 2 12-16-2004 07:44 AM
automatically logging in? bobbens Debian 2 11-01-2004 06:49 AM
Automatically logging in a user from runlevel 3 VxJasonxV Linux - General 9 02-29-2004 04:25 PM
running a script automatically when Logging out? hamster Linux - General 2 06-03-2003 09:49 PM

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

All times are GMT -5. The time now is 06:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration