diff options
Diffstat (limited to 'shellrc')
-rw-r--r-- | shellrc/APKBUILD | 3 | ||||
-rwxr-xr-x | shellrc/prompt.sh | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/shellrc/APKBUILD b/shellrc/APKBUILD index a60f9c6..c281eb4 100644 --- a/shellrc/APKBUILD +++ b/shellrc/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Karel Kočí <cynerd@email.cz> pkgname=shellrc pkgver=0.7.5 -pkgrel=1 +pkgrel=2 pkgdesc="Shell initialization files" url="https://git.cynerd.cz/shellrc/" arch="noarch" @@ -13,6 +13,7 @@ options="!check" package() { "$builddir/install" --prefix "$pkgdir" + cp prompt.sh "$pkgdir/etc/profile.d/prompt.sh" } zsh() { diff --git a/shellrc/prompt.sh b/shellrc/prompt.sh new file mode 100755 index 0000000..7a857da --- /dev/null +++ b/shellrc/prompt.sh @@ -0,0 +1,12 @@ +# Better prompt +case "$TERM" in + xterm*|rxvt*) + export PS1='$(EC=$? +[ $EC = 0 ] || echo -n "\e[1;33m$EC:" +if [ `id -u` -eq "0" ]; then + echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] " +else + echo -n "\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] " +fi)' + ;; +esac |