-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_bashrc
53 lines (44 loc) · 1.23 KB
/
dot_bashrc
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/bash
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
# make bash play dumb unless intentionally launched by user
if [ "${SSH_CONNECTION}${TERM_PROGRAM}" ] && tty -s; then
# if we've not launched from fish and fish exists, exec fish
if echo "${SHELL}" | grep -q bash && tty -s && type -P fish > /dev/null; then
exec fish -l
fi
# add brew to PATH
for brew in /opt/homebrew /home/linuxbrew/.linuxbrew; do
if [ -d $brew ]; then
eval "$(${brew}/bin/brew shellenv)"
fi
done
# add nix-profile to PATH
for nix in /nix/var/nix/profiles/default/bin $HOME/.nix-profile/bin /run/wrappers/bin; do
if [ -d "$nix" ]; then
PATH="${nix}:${PATH}"
fi
done
PS1="$(hostname -s)@$(whoami)> "
# hook starship
if tty -s && type starship &> /dev/null; then
eval "$(starship init bash)"
fi
fi