Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
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.
I want to write a login script, which will open mozilla with default page after a user's login. Please tell me how to write the script? Where to store it and how to run and how to automate it?
If your using a graphical login, you can try creating the .bash_login file in the users home directory and placing whatever programs you want started there.
Hi all
Thanks for quick reply. I am using ICE wm. I can create .bash_login file but can you forward me some sample files and the procedure how to activate and run it. Waiting For Reply.
I did everything in .xinitrc but no effect. At command prompt I am typing mozilla to get browser open. But same command is not working in .xinitrc file. It is having -rwxr--r-- permissions.
I did everything in .xinitrc but no effect. At command prompt I am typing mozilla to get browser open. But same command is not working in .xinitrc file. It is having -rwxr--r-- permissions.
Please help me.
Because that file is not made or used to start programs at the start of X. Did you try the .bash_login ?
Or whatever before you have the line with exec and your windowmanager's name.
But this overrides the default behavior of the windowmanager and might be ignored by kdm or gdm if they see the file is not executable. It is possible to do this independant of windowmanger.
If you want to do this for all users then you are going to have to do it independant of the windowmanager. Investigate Xsession for the display manager of your choice.
/usr/X11R6/lib/X11/xdm/Xsession for xdm. You can add commands to be run in this file. Be very careful and test well.
EDIT: Please note, you must run this command before the user's .xsession is executed (as their .xsession never returns until they logout) and it must be run in the background.
Okay, a little playing around on my home system. Keep in mind, I use xdm as my display manager. The process is similar if you use kdm or gdm but the files will be different.
One thing that you should do, if you are making a global change like this, is have a way to opt-out for your users. Tina may love this but it could drive Joe flipping nuts. The way I solved this problem in my tooling around was just creating a file if you want to run the homepage program.
/usr/X11R6/lib/X11/xdm/Xsession [snippet]
Code:
openhomepagep=$HOME/.xsession.homepage
# The following block checks to see if the file ~/.xsession.homepage exists.
# If it does, regardless of the contents, execute the following commend. In
# a more extendable situation the file could be setup to contain the default
# command and then executed here instead of the command. This file would
# have to return and must not be called with exec.
# In either case, this can be made the default by configuring the system to
# include this file (with the contents desired if the later route is taken)
# with each new user.
if [ -e "$openhomepagep" ]; then
firefox &
fi
I think the comments explain it pretty well. In this case I made it pretty static. No need to do anything funky with the file... it just needs to exist. If it does then firefox will be run in the background for that user. If it doesn't then nothing will be run. You just put this right before the block testing for .xsession.
There are other ways to do this depending on your system. If you want EVERYONE to always have it unless they specifically opt-out, then you can reverse the test and run firefox if the file is not found. So the user would need to create the file to stop it from running instead of remove it. And of course, the comments talk about using a more dynamic system where you call a user modifiable script to start the web-browser -- if the script exists.
Basically, have fun with this. But make sure you keep it so that the least amount of users are likely to be bothered by it. If you are the only user and will remain the only user... then you can do it however you like (I recommend ~/.xsession for that case... leave the global files alone).
Frob23 thank you very much. I tried this solution also, but unfortunately it is not working. Here is my setup,
We are having Redhat 9.0 server, which is serving to 40 HCL thin clients. On thine clients ICE sessions are there On this setup whenever a user logs in I want to open mozilla with a default page.
Am I stupid or is the answer in the link that I gave before?
Code:
The startup file can list apps you want to start at IceWM startup.
It can look like this:
idesk&
(sleep 2; psi&)&
Do not forget to make this file executable
chmod +x startup
Note: Do not put shell specification (like #!/bin/bash) on the
beginning of the file. Also make sure all applications are
starting at background (&).
Last edited by Wim Sturkenboom; 02-17-2005 at 09:39 AM.
Wim don't get angry. I tried your solution also. I followed your link, previously given. As per your instructions I created Startup file. In that I wrote the command to start mozilla. But still it is not working. My startup file looked like
mozilla &
Is it correct? I am trying very hard for the problem.
Thanks for help. Anybody please suggest me the solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.