-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.shrc
More file actions
101 lines (79 loc) · 2.46 KB
/
.shrc
File metadata and controls
101 lines (79 loc) · 2.46 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#HACK: Ideally this should be an export in '.profile., but it's not working properly on Debian 11.
OS_NAME="$(uname -s)"
# If not running interactively, don't do anything.
case $- in
*i*) ;;
*) return;;
esac
# Only run this if the shell is interactive and stdin is a TTY
if [ -t 0 ]; then
CURRENT_TTY=$(tty)
case "$CURRENT_TTY" in
"/dev/tty6"|"/dev/ttyC5")
# Clear the screen first for a clean "Dashboard" look
clear
echo "Starting System Monitor..."
exec top
;;
esac
fi
SHELL_CMD="$(ps -o ucomm= -p $$)"
# Set up prompt for non-Bash shells.
if [ ! "$SHELL_CMD" = "bash" ]; then
if [ -f "/etc/debian_version" ]; then
if [ ! "$SHELL_CMD" = "sh" ] && [ ! "$SHELL_CMD" = "dash" ] && [ ! "$SHELL_CMD" = "ksh" ]; then
PS1='\w $ '
fi
elif [ "$OS_NAME" = "OpenBSD" ]; then
PS1='\[\033[0;33m\]\w\[\033[0m\] $ '
fi
fi
# Hash the location of an utility if it is executed, so that future invocations do not need to search for it.
if [ "$SHELL_CMD" = "ksh" ]; then
set -h
fi
# Set console language to English. See locale(7) for more info.
export LANG=en_US.UTF-8
export LANGUAGE=en_US
if [ $(command -v editor) ]; then
# Detect (if possible) text editor and use it
export EDITOR=$(command -v editor)
else
# Otheriwse, manually set your favourite editor.
export EDITOR=nano
fi
if [ "$OS_NAME" = "Linux" ]; then
export SU_CMD=sudo
elif [ "$OS_NAME" = "OpenBSD" ]; then
export SU_CMD=doas
fi
# Set history size.
HISTSIZE=10000
# Make less more friendly for non-text input files, see lesspipe(1)
[ $(command -v lesspipe) ] && eval "$(lesspipe)"
# Enable color support of ls and also add handy aliases.
if [ $(command -v dircolors) ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
alias dotver="cat .dotfiles_version"
# CUSTOM FUNCTIONS
if [ -f ~/.shell_functions ]; then
. ~/.shell_functions
fi
# CUSTOM ALIASES
if [ -f ~/.shell_aliases ]; then
. ~/.shell_aliases
fi
# CUSTOM LOCAL FUNCTIONS
if [ -f ~/.shell_functions.local ]; then
. ~/.shell_functions.local
fi
# CUSTOM LOCAL ALIASES
if [ -f ~/.shell_aliases.local ]; then
. ~/.shell_aliases.local
fi