# # ~/.bashrc # # If not running interactively, don't do anything [[ $- != *i* ]] && return # Make colorcoding available for everyone Black='\[\e[0;30m\]' # Black Red='\[\e[0;31m\]' # Red Green='\[\e[0;32m\]' # Green Yellow='\[\e[0;33m\]' # Yellow Blue='\[\e[0;34m\]' # Blue Purple='\[\e[0;35m\]' # Purple Cyan='\[\e[0;36m\]' # Cyan White='\[\e[0;37m\]' # White # Bold BBlack='\[\e[1;30m\]' # Black BRed='\[\e[1;31m\]' # Red BGreen='\[\e[1;32m\]' # Green BYellow='\[\e[1;33m\]' # Yellow BBlue='\[\e[1;34m\]' # Blue BPurple='\[\e[1;35m\]' # Purple BCyan='\[\e[1;36m\]' # Cyan BWhite='\[\e[1;37m\]' # White # Background On_Black='\[\e[40m\]' # Black On_Red='\[\e[41m\]' # Red On_Green='\[\e[42m\]' # Green On_Yellow='\[\e[43m\]' # Yellow On_Blue='\[\e[44m\]' # Blue On_Purple='\[\e[45m\]' # Purple On_Cyan='\[\e[46m\]' # Cyan On_White='\[\e[47m\]' # White NC='\[\e[m\]' # Color Reset ALERT="${BWhite}${On_Red}" # Bold White on red background # Set PATH so it includes user's private bin directories PATH="${HOME}/bin:${HOME}/.local/bin:${PATH}" # Set prompt PS1="${Cyan}\u@\h${NC}: ${Blue}\w${NC} \\$ " # Useful aliases alias c='clear' alias ..='cd ..' alias ls='ls -CF --color=auto' alias ll='ls -lisa --color=auto' alias mkdir='mkdir -pv' alias free='free -mt' alias ps='ps auxf' alias psgrep='ps aux | grep -v grep | grep -i -e VSZ -e' alias wget='wget -c' alias histg='history | grep' alias myip='curl ipv4.icanhazip.com' ## Colorize the grep command output for ease of use (good for log files)## alias grep='grep --color=auto' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' #readable output alias df='df -h' #free alias free="free -mt" # Aliases for software managment pacman alias pacman='sudo pacman --color auto' alias pacman-update='sudo pacman -Syu' alias aur-update='paru -Syu' #pacman unlock alias unlock="sudo rm /var/lib/pacman/db.lck" alias rmpacmanlock="sudo rm /var/lib/pacman/db.lck" #grub update alias grub-update="sudo grub-mkconfig -o /boot/grub/grub.cfg" #switch between bash and zsh alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'" alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'" #hardware info --short alias hw="hwinfo --short" #youtube-dl alias yta-aac="youtube-dl --extract-audio --audio-format aac " alias yta-best="youtube-dl --extract-audio --audio-format best " alias yta-flac="youtube-dl --extract-audio --audio-format flac " alias yta-m4a="youtube-dl --extract-audio --audio-format m4a " alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 " alias yta-opus="youtube-dl --extract-audio --audio-format opus " alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis " alias yta-wav="youtube-dl --extract-audio --audio-format wav " alias ytv-best="youtube-dl -f bestvideo+bestaudio " #get the error messages from journalctl alias jctl="journalctl -p 3 -xb" #systeminfo alias probe="sudo -E hw-probe -all -upload" alias sysfailed="systemctl list-units --failed" #shutdown or reboot alias sshutnow="sudo shutdown now" alias sreboot="sudo reboot" #give the list of all installed desktops - xsessions desktops alias xdesktops="ls /usr/share/xsessions" # # ex = EXtractor for all kinds of archives # # usage: ex 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) tar xf $1 ;; *) echo "'$1' cannot be extracted via ex()" ;; esac else echo "'$1' is not a valid file" fi }