From 846af1d8e819996e05246a5eb8539dea23079529 Mon Sep 17 00:00:00 2001 From: frosty Date: Wed, 24 Jul 2024 15:57:46 -0400 Subject: [PATCH] lots of qol stuff in bashrc --- .bashrc | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 02824ff..a77c37d 100644 --- a/.bashrc +++ b/.bashrc @@ -14,14 +14,39 @@ shopt -s histverify # Default options alias ls='ls --color=auto -AF' alias grep='grep --color=auto' +alias wget='wget --no-hsts' # Shorthands alias l='ls' alias c='cd' alias v='vim' +alias d='docker' +alias f='fastfetch' +alias g='git' -# Other options +# Other options and commands alias ll='ls -l' +alias gs='git status' +alias ga='git add' +alias gc='git commit' +alias gp='git push' +alias dc='docker compose' + +# Common files and directories +alias M='cd ~/compose' +alias D='cd ~/dotfiles' +alias S='cd ~/.ssh' +C() { + case "$HOSTNAME" in + blizzard) cd ~/compose/caddy ;; + *) printf '%s' "Did you mean to be on blizzard?" ;; + esac +} + +alias R='vim ~/.bashrc' +alias P='vim ~/.bash_profile' +alias V='vim ~/.vim/vimrc' +alias G='vim ~/.gitconfig' # List files on 'cd' cd() { @@ -34,7 +59,37 @@ parse_git_dirty() { } parse_git_branch() { - git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ (\1$(parse_git_dirty))/" + command -v git >/dev/null 2>&1 || return + while IFS= read -r line; do + [ -z "$line" ] && return + printf '%s' " (${line#* }$(parse_git_dirty))" + done </dev/null) +EOF } export PS1="\n\[\e[36m\]\t\[\e[m\] \[\e[31m\]\h\[\e[m\] \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " + +# Startup screen +clear +case "$HOSTNAME" in + blizzard) + printf '%s' "\ + _ _ _ _ +| |__ | (_)__________ _ _ __ __| | +| '_ \\| | |_ /_ / _\` | '__/ _\` | +| |_) | | |/ / / / (_| | | | (_| | +|_.__/|_|_/___/___\\__,_|_| \\__,_| +" + ;; + glacier) + printf '%s' "\ + _ _ + __ _| | __ _ ___(_) ___ _ __ + / _\` | |/ _\` |/ __| |/ _ \\ '__| +| (_| | | (_| | (__| | __/ | + \\__, |_|\\__,_|\\___|_|\\___|_| + |___/ +" + ;; +esac