-
Notifications
You must be signed in to change notification settings - Fork 1
/
sh-rc.sh
66 lines (53 loc) · 1.12 KB
/
sh-rc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# sh-rc.sh
# If not running interactively, don't do anything
case "$-" in
*i*) ;;
*) return;;
esac
[ -f "$HOME/.config/sh/paths.sh" ] && . "$HOME/.config/sh/paths.sh"
[ -f "$HOME/.config/sh/aliases.sh" ] && . "$HOME/.config/sh/aliases.sh"
[ -z "$WAYLAND_DISPLAY$DISPLAY" -a $(tty) = "/dev/tty1" ] && \
command -v sway > /dev/null && \
exec sway-session
HISTFILE="$HOME/.local/state/sh.history"
HISTSIZE=64000
HISTFILESIZE=64000
HISTCONTROL=ignoredups:erasedups
if [ -n "$BASH_VERSION" ]; then
shopt -s histappend
hn="$(uname -n)"
case "$hn" in
olv-glaptop4*)
hn="x1"
;;
olv-ct-22*)
hn="ct"
;;
*)
hn="\h"
;;
esac
# for cros chroot
if [ -n "$CROS_WORKON_SRCROOT" ]; then
hn="cros-sdk"
unset LESS
cd ~/chromiumos/src/scripts
fi
PS1="\u@$hn:\w\$ "
# set window title as well
PS1="\[\e]2;\u@$hn:\w\a\]$PS1"
unset hn
else
PS1='$USER:$PWD$ '
fi
if command -v infocmp > /dev/null; then
if ! infocmp "$TERM" > /dev/null 2>&1; then
TERM="xterm-256color"
fi
if [ -z "$COLORTERM" ]; then
export COLORTERM="truecolor"
fi
fi
if command -v dircolors > /dev/null; then
eval $(dircolors -b)
fi