[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use zsh as login shell
From: |
Ludovic Courtès |
Subject: |
Re: use zsh as login shell |
Date: |
Fri, 05 Dec 2014 00:10:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
宋文武 <address@hidden> skribis:
> Ludovic Courtès <address@hidden> writes:
>
>> 宋文武 <address@hidden> skribis:
[...]
>>>> 3. The skeleton for ~/.bash_profile sources /etc/profile, /etc/bashrc,
>>>> and ~/.bashrc.
>>>>
>>>> 4. The definition of PS1 is moved from /etc/profile to /etc/bashrc.
>>>>
>>>> 5. The skeleton for ~/.bashrc sources /etc/bashrc.
>>> It seem too much, what I suggested is:
>>> for login, su (pam_env): /etc/environment
>>> for login shell: ~/.bash_profile, ~/.zlogin
>>> for interactive: ~/.bashrc, ~/.zshrc
>>> skeletons only installed when needed :)
>>
>> As a first step, what about always installing the skeletons? Then we
>> can see whether/how to refine that.
[...]
> From 1e400957b29a47f63548df39b36a7c0f1d8a37d9 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <address@hidden>
> Date: Tue, 2 Dec 2014 21:40:52 +0800
> Subject: [PATCH] gnu: Add /etc/environment.
>
> * gnu/system.scm (default-/etc/environment): New procedure.
> (etc-directory)[profile]: Remove it.
> (etc-directory)[environment]: Add it.
> * gnu/system/linux.scm (unix-pam-service): Add #:readenv? parameter.
> * gnu/services/base.scm (mingetty-service): Pass #t as #:readenv?
> to unix-pam-service.
> * gnu/system/shadow.scm (default-skeletons): Add .bash_profile. Adjust
> .bashrc.
So you ended up choosing pam_env? I thought we had concluded that it
wasn’t needed, no? If it can be avoided, it’s better to do so, IMO.
> + (mlet %store-monad ((bash-profile (text-file "bash_profile" "\
> +# honor ~/.bashrc if the shell is interactive
> +[[ $- == *i* ]] && source ~/.bashrc
I don’t think the test is needed, because ~/.bash_profile is only read
by interactive Bash.
> +# load system-wide environment varibales
> +source /etc/environment
> +
> +# common varibales for user profile
> +export PATH=$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:$PATH
> +export INFOPATH=$HOME/.guix-profile/share/info:$INFOPATH\n"))
> + (bashrc (text-file "bashrc" "\
> +PS1='address@hidden \\w\\$ '
I think PS1 should go to /etc/profile. WDYT?
Thanks!
Ludo’.