dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 5aadf15cdbf5e13b8c7b72f80dcd63082a264666
parent 8236d499646ccd790b7973a35f47f02dd52c34c3
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 27 Jun 2020 07:09:02 -0400

ps1.sh: Dynamically detect user

Diffstat:
Metc/shrc.d/ps1.sh | 12+++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/etc/shrc.d/ps1.sh b/etc/shrc.d/ps1.sh @@ -1,14 +1,8 @@ -uid=$(id -u) - -if [ $uid -ne 0 ] +if [ -n "$SSH_TTY" ] then - PS1='$ ' + PS1="${HOSTNAME}\$(if [ \$(id -u) -ne 0 ]; then echo \$; else echo \#; fi) " else - PS1='# ' + PS1="\$(if [ \$(id -u) -ne 0 ]; then echo \$; else echo \#; fi) " fi -if [ -n "$SSH_TTY" ] -then - PS1="${HOSTNAME}${PS1}" -fi export PS1