about summary refs log tree commit diff stats
path: root/shrc
diff options
context:
space:
mode:
authorCase Duckworth2024-05-30 12:47:11 -0500
committerCase Duckworth2024-05-30 12:47:11 -0500
commit22bc1e1879da0d99e5e1d79b10742b8cc9fd0521 (patch)
treecd813c6d8bfeebe83901b2d749ce97f1231dd547 /shrc
downloaddots-22bc1e1879da0d99e5e1d79b10742b8cc9fd0521.tar.gz
dots-22bc1e1879da0d99e5e1d79b10742b8cc9fd0521.zip
Initial commit
Diffstat (limited to 'shrc')
-rw-r--r--shrc72
1 files changed, 72 insertions, 0 deletions
diff --git a/shrc b/shrc new file mode 100644 index 0000000..8b23731 --- /dev/null +++ b/shrc
@@ -0,0 +1,72 @@
1# ~/.shrc -*- sh -*-
2
3case $- in # only do these things in interactive shells
4 *i*) . ~/.profile ;;
5 *) return ;;
6esac
7
8# Prompt
9# smileycode() {
10# case $? in
11# (0) printf '\e[32m%s\e[0m' '^_^' ;;
12# (*) printf '\e[31m%s\e[0m' ';_;' ;;
13# esac
14# }
15
16ecdollar() {
17 case $? in
18 (0) return ;;
19 (*) printf '*%s ' "$?" ;;
20 esac
21}
22
23pwd_tilde() {
24 printf '%s' "$PWD" | sed 's,'"$HOME"',~,'
25}
26
27case "$0" in
28 *ksh)
29 PS1=$'\1\r$(smileycode)\1 '
30 PS1+=$'\1\e[34m\1$(pwd_tilde)\1\e[0m\1 '
31 PS1+=$'$ '
32 ;;
33 *) PS1='$(ecdollar)\$ \[\e[4m\]\w\[\e[0m\] > '
34 ;;
35esac
36
37# Aliases
38alias ls='ls --color=none -F '
39alias ll='ls -Al'
40
41alias sudo=$SUDO
42for cmd in shutdown reboot halt mount umount poweroff zzz ZZZ
43do alias $cmd="$SUDO $cmd"
44done
45
46# installedp is in ~/.profile
47if installedp bc
48then export BC_ENV_ARGS='-lq'
49fi
50
51if installedp less
52then export LESS='--mouse --RAW-CONTROL-CHARS'
53fi
54
55if installedp apk
56then
57 _apk() (
58 apk=$(which apk)
59 case "$1" in
60 (add|del|update|upgrade) $SUDO "$apk" "$@" ;;
61 (*) "$apk" "$@" ;;
62 esac
63 )
64 alias apk=_apk
65fi
66
67if installedp rlwrap
68then
69 for cmd in sbcl
70 do alias $cmd="rlwrap $cmd"
71 done
72fi