Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a fresh install of Ubuntu Natty. I changed my shell to zsh.

When I login, it does not appear to source my ~/.zprofile file. Does gnome not get executed in a login shell of your chosen shell? Is it always sh?

I went digging in /etc/gdm and found that gdm always sources ~/.profile if it exists, but I couldn't find anything that suggested it was doing anything specific to my chosen shell.

Can anyone help me understand what's going on here?

share|improve this question
add comment

2 Answers

GDM (version 2, I'm not sure about 3) only reads /etc/profile, ~/.profile, /etc/xprofile, and ~/.xprofile. Everything is run with sh.

A possible solution is to use ~/.xprofile and source it from your ~/.zprofile if you do not want to duplicate stuff in multiple files. Remember that ~/.xprofile is sourced from sh so you can't use any zsh syntax or commands in it.

share|improve this answer
add comment

The login shell only affects text mode sessions (i.e. when you type your password in text mode, or when you log in remotely), not graphics mode session (i.e. when you type your password in the GUI).

To have a single file for login-time definitions, put everything in ~/.profile, and source that from ~/.zprofile. An easy way is to make your ~/.zprofile contain the single line

emulate sh -c '~/.profile'

Gdm arranges to load ~/.profile as part of the session setup, so you're fully covered.

See also Zsh not hitting ~/.profile.

share|improve this answer
    
KDM actually executes the session in your chosen shell, so everything you would expect to load, does. In this sense, I think GDM is doing the "wrong thing". –  Jeremy Cantrell May 17 '11 at 15:04
    
@Jeremy After having looked at KDM, I can assure you its doing things "the wrong way" even if it might be a good idea. –  Arrowmaster May 19 '11 at 10:22
    
What's your justification for that? –  Jeremy Cantrell May 20 '11 at 0:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.