mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2026-10-22 04:45:34 +00:00
feat(zsh): support cross-platform shell setup
This commit is contained in:
@@ -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
|
||||
@@ -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 -}}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user