diff --git a/.chezmoitemplates/scripts/commonrc.sh.tmpl b/.chezmoitemplates/scripts/commonrc.sh.tmpl new file mode 100644 index 0000000..4cac696 --- /dev/null +++ b/.chezmoitemplates/scripts/commonrc.sh.tmpl @@ -0,0 +1,78 @@ +# This template's argument is the shell as a string (bash, zsh). + +# general configuration +export EDITOR="micro" +export GPG_TTY=$(tty) +export MICRO_TRUECOLOR=1 +export TERM=xterm-256color # fixes terminal colors when ssh'ing into laptop + +# hishtory +export HISHTORY_SERVER=https://hsh.***REMOVED*** +export PATH="$PATH:$HOME/.hishtory" +{{- if eq . "zsh" -}} +source $HOME/.hishtory/config.zsh +{{- else if eq . "bash" -}} +source $HOME/.hishtory/config.sh +{{- else -}} +{{ fail "Unexpected shell." }} +{{- end -}} + +export PATH=$PATH:~/.local/bin +export PATH=$PATH:/usr/local/go/bin # Go +export PATH="$HOME/go/bin/:$PATH" # Go-installed tools +export PATH="$HOME/.local/share/bob/nvim-bin:$PATH" # Bob, the Neovim package manager +. "$HOME/.deno/env" # Deno +. "$HOME/.cargo/env" # Rustup + Cargo + Cargo-installed tools +eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" # Brew +command -v rbenv &> /dev/null && eval "$(rbenv init -)" # rbenv for Ruby + +# nvm (node version manager) +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# pyenv, python version manager +export PYENV_ROOT="$HOME/.pyenv" +[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" +# pyenv virtual-env +eval "$(pyenv virtualenv-init -)" + +# bun +export BUN_INSTALL="$HOME/.bun" +export PATH="$BUN_INSTALL/bin:$PATH" +[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun" + +# java version manager +if [ -d $HOME/.jenv/bin ]; then + export PATH="$HOME/.jenv/bin:$PATH" + if command -v jenv &> /dev/null + then + eval "$(jenv init -)" + fi +fi + +# pnpm +export PNPM_HOME="$HOME/.local/share/pnpm" +case ":$PATH:" in + *":$PNPM_HOME:"*) ;; + *) export PATH="$PNPM_HOME:$PATH" ;; +esac + +# perl +if [ -d "$HOME/perl5" ]; then + PATH="$HOME/perl5/bin${PATH:+:${PATH}}"; export PATH; + PERL5LIB="$HOME/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; + PERL_LOCAL_LIB_ROOT="$HOME/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; + PERL_MB_OPT="--install_base \"$HOME/perl5\""; export PERL_MB_OPT; + PERL_MM_OPT="INSTALL_BASE=$HOME/perl5"; export PERL_MM_OPT; +fi + +# spicetify +if [ -d "$HOME/.spicetify" ]; then + export PATH=$PATH:$HOME/.spicetify +fi + +# disable screen blanking +# source $(brew --prefix)/share/zsh/site-functions/_todoist_peco +# xset s off && xset -dpms \ No newline at end of file diff --git a/dot_bashrc.tmpl b/dot_bashrc.tmpl index e8f995b..4befac7 100644 --- a/dot_bashrc.tmpl +++ b/dot_bashrc.tmpl @@ -87,15 +87,6 @@ fi # colored GCC warnings and errors #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Add an "alert" alias for long running commands. Use like so: -# sleep 10; alert -alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' - # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. @@ -116,39 +107,4 @@ if ! shopt -oq posix; then fi fi -# PATH Additions -PATH=$PATH:~/.local/bin - -export HISHTORY_SERVER=https://hsh.***REMOVED*** - -# Hishtory Config: -export PATH="$PATH:/home/xevion/.hishtory" -source /home/xevion/.hishtory/config.sh - -# SSH Agent should be running, once -# ps -ef | grep "ssh-agent" -# eval `ssh-agent -s` -# runcount=$(ps -ef | grep "ssh-agent" | grep -v "grep" | wc -l) -# if [ $runcount -eq 0 ]; then - # echo Starting SSH Agent - # eval $(ssh-agent -s) -# fi - -# Ensure at least one key is added, timeout 1 day -# ssh-add -l &>/dev/null -# if ! [ "$?" == 0 ]; then - # echo Adding keys... - # ssh-add -t 1d -# fi - -. "/home/xevion/.deno/env" - -# go lang -export PATH=$PATH:/usr/local/go/bin -# rust lang -. "$HOME/.cargo/env" - -eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - -# Set default chezmoi editor -export EDITOR="micro" +{{ template "scripts/commonrc.sh.tmpl" "bash" }} \ No newline at end of file diff --git a/dot_profile b/dot_profile index 707d0e3..f661e97 100644 --- a/dot_profile +++ b/dot_profile @@ -25,5 +25,6 @@ fi if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi -. "/home/xevion/.deno/env" + +. "$HOME/.deno/env" . "$HOME/.cargo/env" diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 3b2258b..cb10229 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -103,70 +103,4 @@ fi # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -export GPG_TTY=$(tty) -export MICRO_TRUECOLOR=1 - -# rbenv (ruby) -if command -v rbenv &> /dev/null -then - eval "$(rbenv init -)" -fi - -# brew (obsolete by brew plugin) -# eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - -# bun -export BUN_INSTALL="$HOME/.bun" -export PATH="$BUN_INSTALL/bin:$PATH" - -# bun completions -[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun" - -export PATH=$PATH:/usr/local/go/bin -export TERM=xterm-256color # fixes terminal colors when ssh'ing into laptop - -# bob / neovim package manager -export PATH="$HOME/.local/share/bob/nvim-bin:$PATH" - -# java version manager -if [ -d $HOME/.jenv/bin ]; then - export PATH="$HOME/.jenv/bin:$PATH" - if command -v jenv &> /dev/null - then - eval "$(jenv init -)" - fi -fi - -# go tools -export PATH="$HOME/go/bin/:$PATH" - -# pnpm -export PNPM_HOME="/home/xevion/.local/share/pnpm" -case ":$PATH:" in - *":$PNPM_HOME:"*) ;; - *) export PATH="$PNPM_HOME:$PATH" ;; -esac -# pnpm end - -source $(brew --prefix)/share/zsh/site-functions/_todoist_peco - -PATH="/home/xevion/perl5/bin${PATH:+:${PATH}}"; export PATH; -PERL5LIB="/home/xevion/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; -PERL_LOCAL_LIB_ROOT="/home/xevion/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; -PERL_MB_OPT="--install_base \"/home/xevion/perl5\""; export PERL_MB_OPT; -PERL_MM_OPT="INSTALL_BASE=/home/xevion/perl5"; export PERL_MM_OPT; - -# Hishtory Config: -export PATH="$PATH:/home/xevion/.hishtory" -source /home/xevion/.hishtory/config.zsh - -# use personal hishtory server -export HISHTORY_SERVER=https://hsh.***REMOVED*** - -# xset s off && xset -dpms - -export PATH=$PATH:/home/xevion/.spicetify +{{ template "scripts/commonrc.sh.tmpl" "zsh" }} \ No newline at end of file