dotfiles/bashrc

96 lines
2.5 KiB
Bash
Raw Normal View History

2024-03-24 17:21:30 +00:00
bind "set completion-ignore-case on"
export TERM="xterm-256color"
export HISTCONTROL=ignoredups:erasedups
export HISTSIZE=10000
export EDITOR="nvim"
export MANPAGER="/bin/sh -c \"col -b | vim --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
export DOTNET_CLI_TELEMETRY_OPTOUT="1"
export LANG="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LIBVIRT_DEFAULT_URI="qemu:///system"
shopt -s autocd
shopt -s cdspell
shopt -s cmdhist
shopt -s dotglob
shopt -s histappend
shopt -s expand_aliases
shopt -s checkwinsize
alias vim='nvim'
alias pacu='sudo pacman -Syyu'
alias yayu="yay -Sua --noconfirm"
alias yayue="yay -Syu --noconfirm"
alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias cp="cp -i"
alias mv='mv -i'
alias rm='rm -f'
alias df='df -h'
alias ls='ls -l'
alias jctl="journalctl -p 3 -xb"
alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
#PATH
if [ -d "$HOME/.bin" ] ;
then PATH="$HOME/.bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ] ;
then PATH="$HOME/.local/bin:$PATH"
fi
[[ $- != *i* ]] && return
PS1='[\u@\h \W]\$ '
case ${TERM} in
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|alacritty|st|konsole*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
;;
screen*)
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
;;
esac
#Functions
wireguard () {
if [ -f $1 ]; then
case $1 in
up) sudo wg-quick up wg0 ;;
down) sudo wg-quick down wg0 ;;
*) echo "Error" ;;
esac
else
echo "'$1' not valid. Usage: Up || Down"
fi
}
ex () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) unzstd $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}