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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-31-2005, 07:39 PM
|
#1
|
Member
Registered: Aug 2004
Distribution: Mandrake 10.1/Slackware 10.0
Posts: 154
Rep:
|
I want to automatically run a program when a user logs on their account
I know how to use rc.local, but what about automatically running something in the X environment when the user first logs in?
|
|
|
01-31-2005, 07:45 PM
|
#2
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
Are you wanting this to be an X program or from a console or terminal?
Creating a .bash_login usually works for either way.
|
|
|
01-31-2005, 07:48 PM
|
#3
|
Member
Registered: Jan 2005
Distribution: Gentoo
Posts: 111
Rep:
|
isn't that what .xinitrc is for? I may be misunderstanding your question, but in general when the X window system starts up, it checks for the .xinitrc file in the user's home directory. It will then execute what is in that. For instance, I have this:
Code:
xscreensaver &
xpenguins -n 36 &
enlighenment
which will execute the xscreensaver (starting it up), then xpenguins (giving me a bunch of crazy penguins running around everywhere ) and then finally starting my window-manager (enlightenment).
-- the dudeman
|
|
|
01-31-2005, 07:55 PM
|
#4
|
Member
Registered: Aug 2004
Distribution: Mandrake 10.1/Slackware 10.0
Posts: 154
Original Poster
Rep:
|
I think we're on the same page, linuxluser, but I don't see that hidden file in my home directory. What next?
|
|
|
01-31-2005, 11:52 PM
|
#5
|
LQ Newbie
Registered: Apr 2004
Location: Manitoba
Distribution: Mandrake 9.2 & 9.1
Posts: 12
Rep:
|
Missing .xinitrc
I have the same problem, I never had a .xinitrc file in my home directory. I added one to run some commands to remap my mouse wheel so it will scroll properly, but the .xinitrc file never gets parsed (as far as I can tell). The .xinitrc file is shown below:
#!/bin/sh
# (c) 2000-2002 MandrakeSoft
# $Id: xinitrc-xinitrc,v 1.2 2002/09/10 05:53:43 flepied Exp $
# Set a background here because it's not done anymore
# in Xsesion for non root users
if [ "`whoami`" != root ]; then
xsetroot -solid "#21449C"
fi
# the following was added by CJW 2005-01-24 for wheel mouse support
/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"
BINARY=$(which imwheel)
$BINARY -k -p -b "67"
# end addition 2005-01-24
exec /etc/X11/Xsession $*
If I run the "/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"" in a shell everything works fine.
Note that I'm running Mandrake 9.2 and KDE with a graphical logon screen.
If anyone has any thoughts as to why .xinitrc doesn't get parsed, please let me know!
thanks,
jh
|
|
|
02-01-2005, 11:57 AM
|
#6
|
Member
Registered: Dec 2002
Distribution: Debian
Posts: 154
Rep:
|
Quote:
If I run the "/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 6 7 4 5"" in a shell everything works fine.
|
same for me I have to run xmodmap after I login. it isn't getting executed from the xinitrc file.
|
|
|
02-01-2005, 08:20 PM
|
#7
|
Member
Registered: Jan 2005
Distribution: Gentoo
Posts: 111
Rep:
|
If you don't have .xinitrc then you can make it. The man pages (of startx) indicate that when the .xinitrc file exists, the session exits. You need to have everything run in the background except for the last command. That's why I had an ampersand on the end of every line except the last (which loads my window manager). If you don't, you can get a blank screen or a program unexpectantly exiting or something weird like that.
Sorry if I was unclear about that.
-- the dudeman
Last edited by linuxLuser; 02-01-2005 at 08:31 PM.
|
|
|
02-01-2005, 08:55 PM
|
#8
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Graphical login managers (such as xdm, kdm, gdm) will
use the configuration file:
~/.xsession
startx uses:
~/.xinitrc
Try a
mv .xinitrc .xsession
Cheers,
Tink
|
|
|
All times are GMT -5. The time now is 07:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|