-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_bashrc
47 lines (38 loc) · 1.45 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
export PATH="$PATH:$HOME/.local/bin:/opt/nvim/bin"
source "$HOME/.cargo/env"
# If not running interactively, dont do anything
[[ $- != *i* ]] && return
# We all know WSL is the best so fix their issues :)
if [ ! -z ${WSL_DISTRO_NAME-} ] && [ ! -d "/run/user/$UID" ]; then
echo -e "Sorry to keep you from your work...\nUnfortunately, it has been determined that your WSL has not created a \`/run/user/$UID\` folder for you.\nSince this requires privileged rights, your password is required:\n";
read -r -p "Continue? [Y/n]" response
response=${response,,} # tolower
if [[ $response =~ ^(y| ) ]] || [[ -z $response ]]; then
sudo mkdir -p /run/user/$UID && sudo chown $USER:$USER /run/user/$UID;
fi
fi
if command -v mise &> /dev/null; then
eval "$(mise activate bash)"
eval "$(mise hook-env -s bash)"
fi
# Check if zellij or tmux should be used as terminal mutiplexer
if [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ] && [ -z "$ZELLIJ" ]; then
ZELLIJ_AUTO_ATTACH=true
# Use Zellij over tmux if possible
if command -v zellij &> /dev/null; then
if [[ "$ZELLIJ_AUTO_ATTACH" == "true" ]]; then
zellij attach -c main && exit
else
zellij && exit
fi
fi
# Fallback: tmux
if command -v tmux &> /dev/null; then
exec tmux
fi
fi
# Start starship
if command -v starship &> /dev/null; then
eval "$(starship init bash)"
fi
# eval "$(oh-my-posh init bash --config ~/.config/oh-my-posh/config.json)"