aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-06-14 00:15:52 +0200
committerDuncaen <mail@duncano.de>2017-06-14 00:15:52 +0200
commit52bbcf8b0739dce2b225d96378d791fb9fb86b5b (patch)
tree7ec2f75470381fbc00afb39c12e99b122ddba916
parent6be6e04f53e44d979a68ddeecb1748ce6ba1103e (diff)
downloaddotfiles-52bbcf8b0739dce2b225d96378d791fb9fb86b5b.tar.gz
add: kshrc
-rwxr-xr-xinstall.sh6
-rw-r--r--kshrc21
2 files changed, 27 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index 70bac06..4cb6304 100755
--- a/install.sh
+++ b/install.sh
@@ -40,6 +40,11 @@ _mksh() {
msg "INSTALL" "mksh config"
_ln_home "mkshrc" ".mkshrc"
}
+_ksh() {
+ [ -n "$(command -v ksh 2>/dev/null)" ] || return
+ msg "INSTALL" "ksh config"
+ _ln_home "kshrc" ".kshrc"
+}
_yash() {
[ -n "$(command -v yash 2>/dev/null)" ] || return
msg "INSTALL" "yash config"
@@ -90,6 +95,7 @@ _gtk() {
: ${HOME:=~}
_mksh
+_ksh
_yash
_shell
_bin
diff --git a/kshrc b/kshrc
new file mode 100644
index 0000000..5b98892
--- /dev/null
+++ b/kshrc
@@ -0,0 +1,21 @@
+[ -r /etc/ksh.kshrc ] && . /etc/ksh.kshrc
+
+[ -z "$SSH_AUTH_SOCK" ] && [ -r ~/.cache/ssh-agent-info ] && \
+ . ~/.cache/ssh-agent-info
+
+[ -r ~/.aliases ] && . ~/.aliases
+
+case "$TERM" in
+network|dump)
+ PS1=$'\001\r''$(\
+((r=$?)) && e="?$r" || e=;\
+d=${PWD/$HOME/\~}; d=${d##*/};\
+[ "$SSH_CONNECTION" ] && s="@${HOSTNAME:=$(hostname)}" || s=;\
+((USER_ID)) && i=\$ || i=\#;\
+print "$d$s$e$i ")'
+;;
+xterm|*-256color)
+ alias weechat='print "\033]0;weechat\a$d$s$e$i " && weechat'
+ PS1=$'\001\r\W'$([ "$SSH_CONNECTION" ] && print '@\h')'$(((e=$?)) && print "?\e[0;31;40m$e\e[0m")\$ '
+;;
+esac