View previous topic :: View next topic |
Author |
Message |
ejlinux n00b
Joined: 31 May 2002 Posts: 26
|
Posted: Mon Jul 22, 2002 3:54 pm Post subject: can not use .xsession |
|
|
Hi, I have a problem to use .xseesion file to customize my XWindow setting.
I am using KDM and when I put a .xsession file then I can not login into that account. Only after I delete that file, I can login again normally. Any suggestions? |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Mon Jul 22, 2002 3:55 pm Post subject: |
|
|
Can you post your .xsession file below? |
|
Back to top |
|
|
joshtimmons n00b
Joined: 20 Jun 2002 Posts: 4
|
Posted: Mon Jul 22, 2002 4:25 pm Post subject: Is your .xsession set as executable? |
|
|
Is your .xsession set as executable?
try
Code: | chmod +x ~/.xsession |
|
|
Back to top |
|
|
ejlinux n00b
Joined: 31 May 2002 Posts: 26
|
Posted: Mon Jul 22, 2002 8:06 pm Post subject: Not OK so far |
|
|
I put only one line there:
export LANG=zh_CN
after change it to executable, still the same problem. Instead of login into KDE, it falls back to KDM login screen. After I remove .xsession, everything OK again. |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Mon Jul 22, 2002 8:18 pm Post subject: |
|
|
You cannot just have the variable setting alone in your .xsession since this is file that will be executed as the session script file. You can copy over the Xsession file from the xdm directory (from memory /usr/lib/X11/xdm) and make modifications that you need.
There is probably a nicer way to set LANG in KDE, though. |
|
Back to top |
|
|
reverius42 Apprentice
Joined: 16 Jul 2002 Posts: 166 Location: Tucson, AZ
|
Posted: Mon Jul 22, 2002 8:19 pm Post subject: Re: Not OK so far |
|
|
ejlinux wrote: | I put only one line there:
export LANG=zh_CN
after change it to executable, still the same problem. Instead of login into KDE, it falls back to KDM login screen. After I remove .xsession, everything OK again. |
Try making that file
Code: | #!/bin/sh
export LANG=zh_CN |
and see if that does the trick... that tells it to use the shell as an interpreter. _________________ Even a stopped clock gives the right time twice a day. |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Mon Jul 22, 2002 8:39 pm Post subject: Re: Not OK so far |
|
|
This would not work. The .xsession file itself will be "exec"d by the start-up scripts. When the process corresponding to the .xsession file ends, the session is terminated and you will be back at the kdm/xdm window.
reverius42 wrote: | ...Try making that file
Code: | #!/bin/sh
export LANG=zh_CN |
and see if that does the trick... that tells it to use the shell as an interpreter. |
|
|
Back to top |
|
|
mksoft l33t
Joined: 28 May 2002 Posts: 844
|
Posted: Mon Jul 22, 2002 9:08 pm Post subject: |
|
|
wouldn't it be easier to add the export clause to /etc/X11/xdm/Xsession _________________ There's someone in my head but it's not me - Pink Floyd |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Mon Jul 22, 2002 9:09 pm Post subject: |
|
|
Wasn't sure whether he wanted to do it for all users (which I had presumed based on his use of the .xsession file).
For all users, adding to Xsession may be a better idea.
mksoft wrote: | wouldn't it be easier to add the export clause to /etc/X11/xdm/Xsession |
|
|
Back to top |
|
|
mksoft l33t
Joined: 28 May 2002 Posts: 844
|
Posted: Mon Jul 22, 2002 9:33 pm Post subject: |
|
|
Good point, but he's probably the only user on the system
Anyway, to affect only a single user: /etc/X11/xdm/Xsession script checks if there's ~/.xsession if yes executes it, otherwise executes the result of /etc/X11/chooser.sh. So he can simply call it himself in .xession.
.xsession in the user's home dir will probably look like this:
Code: | #!/bin/sh
export LANG=zh_CN
exec "`/etc/X11/chooser.sh`" |
This one should work (famous last words ).
BTW, it doesn't matter if .xseesion is executable or not (at least when running from kdm/gdm/xdm) as Xsession script checks it:
Code: | .....
startup=$HOME/.xsession
# First run ~/.xsession if it exists
if [ -s "$startup" ]; then
if [ -x "$startup" ]; then
exec "$startup"
else
exec /bin/sh "$startup"
fi
..... |
_________________ There's someone in my head but it's not me - Pink Floyd |
|
Back to top |
|
|
reverius42 Apprentice
Joined: 16 Jul 2002 Posts: 166 Location: Tucson, AZ
|
Posted: Mon Jul 22, 2002 9:34 pm Post subject: Re: Not OK so far |
|
|
Naan Yaar wrote: | This would not work. The .xsession file itself will be "exec"d by the start-up scripts. When the process corresponding to the .xsession file ends, the session is terminated and you will be back at the kdm/xdm window.
reverius42 wrote: | ...Try making that file
Code: | #!/bin/sh
export LANG=zh_CN |
and see if that does the trick... that tells it to use the shell as an interpreter. |
|
Of course! You're right. What was I thinking?
I need to stop posting before I've had coffee in the morning.
If you put something else in that file after the "export", like "exec startkde", it will work fine, right? _________________ Even a stopped clock gives the right time twice a day. |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Mon Jul 22, 2002 10:44 pm Post subject: |
|
|
That will work too. Using chooser.sh as mksoft suggests allows the same .xsession file to work with other choices in session managers, say, if he switched to gdm instead.
Quote: |
If you put something else in that file after the "export", like "exec startkde", it will work fine, right?
|
|
|
Back to top |
|
|
ejlinux n00b
Joined: 31 May 2002 Posts: 26
|
Posted: Tue Jul 23, 2002 2:34 am Post subject: new problem |
|
|
Thanks a lot for all these help. By putting the exec "`/etc/X11/chooser.sh`" at the end of the .xsession do the trick. Actually by reading /etc/X11/xdm/Xsession, it is clear that if only there is no .xsession, the clause of exec "`/etc/X11/chooser.sh`" will be executed. So if I did not put that clause at the end of my own .xsession. It would not login me into KDE. Now I have a new problem. I tried to put another
export XMODIFIERS=@im=XSIM after that export LANG=zh_CN. Now I have the same problem as before no login just fall back to KDM. I know this must be caused by a different problem associated with XIM server. I just wonder how I could set my XIM server for all my X applications instead of only run it from a terminal. |
|
Back to top |
|
|
mksoft l33t
Joined: 28 May 2002 Posts: 844
|
Posted: Tue Jul 23, 2002 6:06 am Post subject: |
|
|
Try setting it in quotes, e.g:
Code: | export XMODIFIERS="@im=XSIM" |
_________________ There's someone in my head but it's not me - Pink Floyd |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Tue Jul 23, 2002 11:39 am Post subject: |
|
|
Don't think this is the problem. It will actually work unquoted:
Code: |
# export XMODIFIERS=@im=XSIM
# echo $XMODIFIERS
@im=XSIM
|
mksoft wrote: | Try setting it in quotes, e.g:
Code: | export XMODIFIERS="@im=XSIM" |
|
What does your .xsession-errors in your home directory say? |
|
Back to top |
|
|
|