-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.shrc
53 lines (40 loc) · 1.52 KB
/
.shrc
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
#!/usr/bin/env sh
# Config dir
export CONF_SH_DIR="$HOME/.sh.d"
# Environment definitions.
# shellcheck source=.sh.d/vars.sh
[ -r "$CONF_SH_DIR/vars.sh" ] && . "$CONF_SH_DIR/vars.sh"
# Function definitions.
# shellcheck source=.sh.d/func.sh
[ -r "$CONF_SH_DIR/func.sh" ] && . "$CONF_SH_DIR/func.sh"
# PATH definition
# shellcheck source=.sh.d/path.sh
[ -r "$CONF_SH_DIR/path.sh" ] && . "$CONF_SH_DIR/path.sh"
# Hook definitions
# shellcheck source=.sh.d/hooks.sh
[ -r "$CONF_SH_DIR/hooks.sh" ] && . "$CONF_SH_DIR/hooks.sh"
# Completion definitions
# shellcheck source=.sh.d/completion.sh
[ -r "$CONF_SH_DIR/completion.sh" ] && . "$CONF_SH_DIR/completion.sh"
xhost +local:root > /dev/null 2>&1
usable complete && complete -cf sudo
# Expand aliases on non-interactive shell too
usable shopt && shopt -s expand_aliases
# Alias definitions.
# shellcheck source=.sh.d/aliases.sh
[ -r "$CONF_SH_DIR/aliases.sh" ] && . "$CONF_SH_DIR/aliases.sh"
# Platform-aware definitions (WSL, CYGWIN,...).
for f in "$CONF_SH_DIR"/platform_*.sh; do
# shellcheck source=.sh.d/platform_raspbian.sh
[ -r "$f" ] && . "$f"
done
# Shell-aware definitions. Check current shell and source from corresponding shell config script.
if [ -n "$ZSH_VERSION" ]; then
# shellcheck source=.sh.d/.zshrc
[ -r "$CONF_SH_DIR/.zshrc" ] && . "$CONF_SH_DIR/.zshrc"
elif [ -n "$BASH_VERSION" ]; then
# shellcheck source=.sh.d/.bashrc
[ -r "$CONF_SH_DIR/.bashrc" ] && . "$CONF_SH_DIR/.bashrc"
fi
# Custom definitions
[ -r "$HOME/.shrc.user" ] && . "$HOME/.shrc.user"