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
|
HISTSIZE=99999999
|
||||||
SAVEHIST=99999999
|
SAVEHIST=99999999
|
||||||
|
|
||||||
|
if [[ -f "$HOME/.config/settings.conf" ]]; then
|
||||||
source "$HOME/.config/settings.conf"
|
source "$HOME/.config/settings.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# User scripts
|
||||||
|
export PATH="$HOME/bin:$PATH"
|
||||||
|
|
||||||
# Text Editor
|
# Text Editor
|
||||||
export EDITOR='emacs -nw'
|
export EDITOR='emacs -nw'
|
||||||
alias emacs="${EDITOR}"
|
alias emacs="${EDITOR}"
|
||||||
alias e="${EDITOR}"
|
alias e="${EDITOR}"
|
||||||
export TERM=xterm
|
|
||||||
|
|
||||||
# Search
|
# Search
|
||||||
alias g='grep -Irn'
|
alias g='grep -Irn'
|
||||||
@@ -36,9 +40,14 @@ alias dote="${DOT_PROGRAM} edit --apply"
|
|||||||
alias dotu="${DOT_PROGRAM} update"
|
alias dotu="${DOT_PROGRAM} update"
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
|
{{ if eq .chezmoi.os "darwin" -}}
|
||||||
|
alias i='brew install'
|
||||||
|
alias d='brew'
|
||||||
|
{{ else -}}
|
||||||
alias i='sudo dnf install'
|
alias i='sudo dnf install'
|
||||||
alias d='sudo dnf'
|
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'
|
alias h='cd ~/git/cacolglazier.com/ && hugo server'
|
||||||
|
|
||||||
# OpenCode
|
# OpenCode
|
||||||
@@ -80,7 +89,8 @@ GCC_PATH=~/dev/gcc-arm-none-eabi-10-2020-q4-major/bin
|
|||||||
export PATH=$GCC_PATH:$PATH
|
export PATH=$GCC_PATH:$PATH
|
||||||
|
|
||||||
# AM auto complete
|
# AM auto complete
|
||||||
|
if [[ -f "$HOME/.local/share/bash-completion/completions/am" ]]; then
|
||||||
autoload bashcompinit
|
autoload bashcompinit
|
||||||
bashcompinit
|
bashcompinit
|
||||||
source "/home/aqua/.local/share/bash-completion/completions/am"
|
source "$HOME/.local/share/bash-completion/completions/am"
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user