4

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?

2 Answers2

1

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.

1

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.