Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # ~/.bashrc
- #
- # If not running interactively (ie. from a script), don't do anything
- [[ $- != *i* ]] && return
- # Use bash-completion, if available, with <TAB> <TAB> - from https://github.com/scop/bash-completion
- [[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
- . /usr/share/bash-completion/bash_completion
- # Enable following line if bash completion not working for sudo commands
- # complete -cf sudo
- # Change the window title of X terminals
- case ${TERM} in
- xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*)
- PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
- ;;
- screen*)
- PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
- ;;
- esac
- alias cp="cp -i" # confirm before overwriting something
- alias df='df -h' # human-readable sizes
- alias free='free -m' # show sizes in MB
- alias np='nano -w PKGBUILD'
- alias more=less
- alias ping='ping -c 10'
- alias less='less -R'
- alias cls='clear'
- # Show system stats
- alias stats='neofetch'
- # Change directory aliases
- alias home='cd ~'
- alias cd..='cd ..'
- alias ..='cd ..'
- alias ...='cd ../..'
- alias ....='cd ../../..'
- alias .....='cd ../../../..'
- # Directory listings
- alias lsall='exa -l --all --icons --group-directories-first --header'
- alias lsdir='exa --tree --only-dirs --level=3'
- alias ls='ls -g --group-directories-first --color=auto' # Default if ls used
- # Directory space usage
- alias space='ncdu -x --exclude /run/media --color dark /'
- # Search command line history then i=use !no to execute line no
- alias h="history|grep "
- # Search running processes
- alias p="ps aux|grep "
- alias topcpu="/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10"
- # Count all files (recursively) in the current folder
- alias countfiles="for t in files links directories; do echo \`find . -type \${t:0:1} | wc -l\` \$t; done 2> /dev/null"
- # Show current network connections to the server
- alias ipview="netstat -anpl | grep :80 | awk {'print \$5'} | cut -d\":\" -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *\$//'"
- # Show all logs in /var/log
- alias logs="sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f"
- # Allows local "root" user to connect to X server to run GUI apps
- xhost +local:root > /dev/null 2>&1
- # Bash won't get SIGWINCH if another process is in the foreground.
- # Enable checkwinsize so that bash will check the terminal size when
- # it regains control.
- # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
- shopt -s checkwinsize
- shopt -s expand_aliases
- # Enable history appending instead of overwriting. #139609
- shopt -s histappend
- # Ignore duplicates for History
- export HISTCONTROL=ignoredups
- # # ex - archive extractor
- # # usage: ex <file>
- 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 ;;
- *) echo "'$1' cannot be extracted via ex()" ;;
- esac
- else
- echo "'$1' is not a valid file"
- fi
- }
- # better yaourt colors
- YAOURT_COLORS="nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35"
- export PATH="$PATH:/home/danie/.local/bin"
- export VISUAL="nano"
- export EDITOR="/usr/bin/nano"
- export QT_QPA_PLATFORMTHEME="qt5ct"
- # 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
- # Run Starship bash prompt - config file is ~/.config/starship.toml
- eval "$(starship init bash)"
- # Run Autojump folder navigation with letter 'j'
- . /usr/share/autojump/autojump.bash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement