if [ -f ~/.wal_alias ]; then . ~/.wal_alias fi [ -f ~/.fzf.bash ] && source ~/.fzf.bash # Cargo config [ -f ~/.cargo ] && source "$HOME/.cargo/env" CAT_PATH=$(which cat --skip-alias) if [ -f ~/.cache/wal/sequences ]; then $CAT_PATH ~/.cache/wal/sequences fi export EDITOR=$(which vim) BPYTOP_PATH=$(which bpytop) if [ ! -z "$BPYTOP_PATH" ]; then alias htop="bpytop -b \"cpu mem net proc\"" fi EXA_PATH=$(which exa) if [ ! -z "$EXA_PATH" ]; then alias ls="$EXA_PATH" alias ll="$EXA_PATH -lahg" alias lg="$EXA_PATH -lahg --git" fi BAT_PATH=$(which bat) if [ ! -z "$BAT_PATH" ]; then export MANPAGER="$BAT_PATH" alias cat="$BAT_PATH" fi # Platform agnostic aliases export TMUX_PATH=$(which tmux --skip-alias) alias tmuxn="$TMUX_PATH new -s $1" alias tmuxa="$TMUX_PATH attach -t $1" alias tmuxl="$TMUX_PATH ls" alias tmuxq="echo $TMUX" alias httpserver="python -m SimpleHTTPServer" if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]] then PATH="$HOME/.local/bin:$HOME/bin:$PATH" fi export PATH # HN Helper functions # Pull up comments for number export HN_PATH=$(which hn) hnc() { if [ ! -z "$HN_PATH" ]; then hn view -c $1 | less -r else echo "hn not in path" fi } export HIMALAYA_PATH=$(which himalaya) if [ ! -z $HIMALAYA_PATH ]; then . ~/Repos/dotfiles/himalaya/himalaya_shell_ui.sh fi # GPG Decrypt wrapper export GPG_PATH=$(which gpg) if [ ! -z $GPG_PATH ]; then function encrypt() { if [ -z $1 ]; then echo "Must pass path to this function" return 1 fi gpg -c --armor --cipher-algo AES256 --no-symkey-cache --output $1.asc $1 } function decrypt() { if [ -z $1 ]; then echo "Must pass path to this function" return 1 fi gpg --no-symkey-cache -d $1 } fi # Case defines platform specific configs # Platform agnostic configs above case $(hostname) in Simons-MacBook-Pro.local) export PS1="\w λ > \[$(tput sgr0)\]" # Mac aliases alias shorten-ps1="PS1='λ > '" alias default-ps1='PS1="\w λ > \[$(tput sgr0)\]"' alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs" # PATH setups PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/swatson/.fzf/bin:/Users/swatson/Library/Python/3.8/bin' default-ps1 clear echo "Loaded MacM1 config" ;; swatson-casana) export TERM=xterm-256color # This fixes some vim issues export PS1="\[\033[36m\]\w\[\033[m\] λ " # function to set terminal title function set-title() { if [[ -z "$ORIG" ]]; then ORIG=$PS1 fi TITLE="\[\e]2;$*\a\]" PS1=${ORIG}${TITLE} } alias ssh-old="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1" alias sleep-open="sudo zzz && slock" alias ssh-aws="ssh -i ~/.ssh/aws_key" # Load non tracked aliases for work specific things source ~/Work/secure_shell_aliases echo "Loaded Void Work Config" ;; void) export PS1="\[\033[36m\]\w\[\033[m\] λ " alias shorten-ps1="PS1='λ > '" echo "Loaded Void config" esac