From 22bc1e1879da0d99e5e1d79b10742b8cc9fd0521 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 May 2024 12:47:11 -0500 Subject: Initial commit --- shrc | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 shrc (limited to 'shrc') diff --git a/shrc b/shrc new file mode 100644 index 0000000..8b23731 --- /dev/null +++ b/shrc @@ -0,0 +1,72 @@ +# ~/.shrc -*- sh -*- + +case $- in # only do these things in interactive shells + *i*) . ~/.profile ;; + *) return ;; +esac + +# Prompt +# smileycode() { +# case $? in +# (0) printf '\e[32m%s\e[0m' '^_^' ;; +# (*) printf '\e[31m%s\e[0m' ';_;' ;; +# esac +# } + +ecdollar() { + case $? in + (0) return ;; + (*) printf '*%s ' "$?" ;; + esac +} + +pwd_tilde() { + printf '%s' "$PWD" | sed 's,'"$HOME"',~,' +} + +case "$0" in + *ksh) + PS1=$'\1\r$(smileycode)\1 ' + PS1+=$'\1\e[34m\1$(pwd_tilde)\1\e[0m\1 ' + PS1+=$'$ ' + ;; + *) PS1='$(ecdollar)\$ \[\e[4m\]\w\[\e[0m\] > ' + ;; +esac + +# Aliases +alias ls='ls --color=none -F ' +alias ll='ls -Al' + +alias sudo=$SUDO +for cmd in shutdown reboot halt mount umount poweroff zzz ZZZ +do alias $cmd="$SUDO $cmd" +done + +# installedp is in ~/.profile +if installedp bc +then export BC_ENV_ARGS='-lq' +fi + +if installedp less +then export LESS='--mouse --RAW-CONTROL-CHARS' +fi + +if installedp apk +then + _apk() ( + apk=$(which apk) + case "$1" in + (add|del|update|upgrade) $SUDO "$apk" "$@" ;; + (*) "$apk" "$@" ;; + esac + ) + alias apk=_apk +fi + +if installedp rlwrap +then + for cmd in sbcl + do alias $cmd="rlwrap $cmd" + done +fi -- cgit 1.4.1-21-gabe81