I want to automatically run a program when a user logs on their account
Linux - NewbieThis 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.
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).
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:
# 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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.