-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshell-init
98 lines (82 loc) · 2.51 KB
/
shell-init
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
#!/usr/bin/env bash
# Copyright (C) Harsh Shandilya <[email protected]>
# SPDX-License-Identifier: MIT
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)/scripts"
# shellcheck disable=SC1091
if [ -e "${HOME}"/.nix-profile/etc/profile.d/nix.sh ]; then
source "${HOME}"/.nix-profile/etc/profile.d/nix.sh
fi
# Local bin directory
[ -d "${HOME}/bin" ] && export PATH="${HOME}/bin:${PATH}"
# SDKMAN!
export SDKMAN_DIR="${HOME}/.sdkman"
# shellcheck disable=SC1091
[[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh"
# cargo env
# shellcheck disable=SC1091
if [ -f "${HOME}"/.cargo/env ]; then
source "${HOME}"/.cargo/env
fi
# Shell PS1
# shellcheck disable=SC2154
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;34m\]\W\[\033[00m\]$(__git_ps1 " (%s)") \$ '
# Set ccache dir
export CCACHE_DIR="${HOME}/.ccache"
# Android env variables
if [ -d ~/Android/Sdk ]; then
export ANDROID_HOME=~/Android/Sdk
fi
# Sexy colors in `ls`
if type vivid &>/dev/null; then
LS_COLORS="$(vivid generate catppuccin-mocha)"
export LS_COLORS
fi
# Bash completion
for DIR in "${HOME}"/bash_completion.d "${HOME}"/.nix-profile/share/bash-completion/completions; do
# shellcheck disable=SC1090
if [ -d "${DIR}" ]; then
for COMPLETION in "${DIR}"/*; do
# shellcheck disable=SC1090
[[ -r $COMPLETION ]] && source "$COMPLETION"
done
fi
done
# Enable pass user extensions
if type pass &>/dev/null; then
export PASSWORD_STORE_ENABLE_EXTENSIONS=true
fi
# Nano love, or is it?
if type micro &>/dev/null; then
export EDITOR=micro
export MICRO_TRUECOLOR=1
fi
# Setup zoxide
if type zoxide &>/dev/null; then
alias cd=z
# zoxide 0.9.7 spams me
export _ZO_DOCTOR=0
fi
# Spicetify
if [ -d "${HOME}/.spicetify" ]; then
export PATH="${PATH}:${HOME}/.spicetify"
fi
# shellcheck source=scripts/bash_completions.bash
source "${SCRIPT_DIR}"/bash_completions.bash
# shellcheck source=scripts/aliases
source "${SCRIPT_DIR}"/aliases
# shellcheck source=scripts/apps
source "${SCRIPT_DIR}"/apps
# shellcheck source=scripts/common
source "${SCRIPT_DIR}"/common
# shellcheck source=scripts/devtools
source "${SCRIPT_DIR}"/devtools
# shellcheck source=scripts/files
source "${SCRIPT_DIR}"/files
# shellcheck source=scripts/gitshit
source "${SCRIPT_DIR}"/gitshit
# shellcheck source=scripts/nix
source "${SCRIPT_DIR}"/nix
# shellcheck source=scripts/system
source "${SCRIPT_DIR}"/system
# shellcheck source=scripts/system_linux
source "${SCRIPT_DIR}"/system_linux