diff --git a/home/dot_zprofile b/home/dot_zprofile deleted file mode 100644 index 8de2da9..0000000 --- a/home/dot_zprofile +++ /dev/null @@ -1,10 +0,0 @@ -sh ~/.config/scripts/setup.sh -nr - -# Load user settings from config file. -. ~/.config/settings.conf - -if [[ $computer == 'w530' ]]; then - if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then - exec startx - fi -fi diff --git a/home/dot_zprofile.tmpl b/home/dot_zprofile.tmpl new file mode 100644 index 0000000..d3adf37 --- /dev/null +++ b/home/dot_zprofile.tmpl @@ -0,0 +1,25 @@ +{{ if eq .chezmoi.os "darwin" -}} +# Initialize Homebrew on Apple Silicon or Intel Macs. +if [[ -x /opt/homebrew/bin/brew ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" +elif [[ -x /usr/local/bin/brew ]]; then + eval "$(/usr/local/bin/brew shellenv)" +fi +{{ else if eq .chezmoi.os "linux" -}} +if [[ -f "$HOME/.config/scripts/setup.sh" ]]; then + sh "$HOME/.config/scripts/setup.sh" -nr +fi +{{ end }} + +# Load user settings from config file. +if [[ -f "$HOME/.config/settings.conf" ]]; then + source "$HOME/.config/settings.conf" +fi + +{{ if eq .chezmoi.os "linux" -}} +if [[ $computer == 'w530' ]]; then + if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then + exec startx + fi +fi +{{ end -}} diff --git a/home/dot_zshrc b/home/dot_zshrc.tmpl similarity index 82% rename from home/dot_zshrc rename to home/dot_zshrc.tmpl index fa88f28..076fbc9 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc.tmpl @@ -16,13 +16,17 @@ HISTFILE=~/.zsh_history HISTSIZE=99999999 SAVEHIST=99999999 -source "$HOME/.config/settings.conf" +if [[ -f "$HOME/.config/settings.conf" ]]; then + source "$HOME/.config/settings.conf" +fi + +# User scripts +export PATH="$HOME/bin:$PATH" # Text Editor export EDITOR='emacs -nw' alias emacs="${EDITOR}" alias e="${EDITOR}" -export TERM=xterm # Search alias g='grep -Irn' @@ -36,9 +40,14 @@ alias dote="${DOT_PROGRAM} edit --apply" alias dotu="${DOT_PROGRAM} update" # Other +{{ if eq .chezmoi.os "darwin" -}} +alias i='brew install' +alias d='brew' +{{ else -}} alias i='sudo dnf install' alias d='sudo dnf' -alias u='sh ~/bin/update.sh' +{{ end -}} +alias u='bash ~/bin/update.sh' alias h='cd ~/git/cacolglazier.com/ && hugo server' # OpenCode @@ -80,7 +89,8 @@ GCC_PATH=~/dev/gcc-arm-none-eabi-10-2020-q4-major/bin export PATH=$GCC_PATH:$PATH # AM auto complete -autoload bashcompinit -bashcompinit -source "/home/aqua/.local/share/bash-completion/completions/am" - +if [[ -f "$HOME/.local/share/bash-completion/completions/am" ]]; then + autoload bashcompinit + bashcompinit + source "$HOME/.local/share/bash-completion/completions/am" +fi