Skip to content

Instantly share code, notes, and snippets.

@Tknott95
Created December 19, 2018 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tknott95/28ca826c1c8900f4bd6fe80c7f105a05 to your computer and use it in GitHub Desktop.
Save Tknott95/28ca826c1c8900f4bd6fe80c7f105a05 to your computer and use it in GitHub Desktop.
.bashrc
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
if [ -f ~/.vimrc ]; then
source ~/.vimrc
fi
xhost +local:root > /dev/null 2>&1
if [ -z "$DISPLAY" -a $XDG_VTNR -eq 1 ]; then
ssh-agent startx
fi
init() {
# i3_gaps_config
complete -c man which
complete -cf sudo
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
alias vi='vim'
alias pyr='python *.py'
}
init
alias i3vi='sudo vim ~/.config/i3/config'
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
webmTOmp4 () {
ffmpeg -i "$1".webm -qscale 0 "$1".mp4
}
mp4TOmp3 () {
ffmpeg -i "$1".mp4 "$1".mp3
}
gad(){
now=$(date+"%C")
git add .
git commit -m "LAZY-0404 _Lazy gad() Commit $now"
git push
}
userAdd() {
# sudo gpasswd -a $USER bumblebee
sudo gpasswd -a x4 video
sudo gpasswd -a x4 bumblebee
}
########################
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
# 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
# use_color=true
# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS. Try to use the external file
# first to take advantage of user additions. Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
match_lhs=""
[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
[[ -z ${match_lhs} ]] \
&& type -P dircolors >/dev/null \
&& match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
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
xhost +local:root > /dev/null 2>&1
complete -cf sudo
# 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. #65623
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize
shopt -s expand_aliases
# export QT_SELECT=4
# Enable history appending instead of overwriting. #139609
shopt -s histappend
#
# # 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
export 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"
alias _cp="xclip -sel clip < "
alias ydl='youtube-dl -x --audio-format mp3 '
# google deployments
alias glist='gcloud app versions list'
alias glete='gcloud app versions delete '
alias gploy='gcloud app deploy --stop-previous-version '
alias glogs='gcloud app logs tail -s default'
#########################
alias ais='cd ~/Workspace/Artispace/'
alias pys='cd ~/Workspace/PythonSpace/'
alias srpt='cd Workspace/Scripts/'
# systemctl
alias sys='sudo systemctl start '
alias syk='sudo systemctl kill '
alias sye='sudo system ctl enable '
# Util Alias
alias brc='sudo vim ~/.bashrc'
alias refresh='source ~/.bash_profile && source ~/.bashrc'
alias rbrc='source ~/.bashrc'
alias trm='gnome-terminal'
# Software Mngr Alias
alias pacn='sudo pacman -S --noconfirm '
alias yacn='yaourt -S --noconfirm '
alias yac='yaourt -S '
alias pac='sudo pacman -S '
alias ysr='yaourt -Ss '
alias psr='sudo pacman -Ss '
alias ya='yaourt '
alias pa='sudo pacman '
alias p3='pip install --user '
# Default
alias ls='ls --color=auto'
alias chpy='chmod +x *.py'
alias chsh='chmod +x *.sh'
alias chgo='chmod +x *.go'
#VGL_ALLOWINDIRECT=1
#VGL_FORCEALPHA=1
#VGL_GLFLUSHTRIGGER=0
#VGL_READBACK=pbo
#VGL_SPOILLAST=0
#VGL_SYNC=1 # use VNC with this one, it is very slow with X11 forwarding
setfont sun12x22
# xrandr --output eDP-1 --mode 3840x2160 --scale 1x1 --dpi 220
export PS1="\n\[$(tput sgr0)\]\[\033[38;5;230m\]\[\033[48;5;17m\]\t\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;15m\]\[\033[48;5;-1m\].\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;69m\]\u\[$(tput sgr0)\]\[\033[38;5;198m\]@\[$(tput sgr0)\]\[\033[38;5;74m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\] \W]\[$(tput sgr0)\e[1;49;36m\]\]--> "
export PS2="\n\[$(tput sgr0)\]\[\033[38;5;230m\]\[\033[48;5;17m\]\t\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;15m\]\[\033[48;5;-1m\].\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;69m\]\u\[$(tput sgr0)\]\[\033[38;5;198m\]@\[$(tput sgr0)\]\[\033[38;5;74m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\] \W]\[$(tput sgr0)\n\e[1;49;36m\]---> "
# CALLING EACH PROC SPAWN
#compton -b -d :0
echo "\n xrandr --output eDP-1 --mode 3840x2160 --scale .75x.75 --dpi 320 \n"
alias pnl='gnome-panel &'
alias dlc='cd ~/Workspace/Artispace/DeepLearningCrypt/'
alias brf='source ~/.bashrc'
export CC=clang
export CXX=clang++
export PATH="$PATH:$HOME/Workspace/Golang/go/bin"
neofetch
cowsay -f eyes "welcome 2 the shire... "
figlet -f big "x4@rch1"
alias i3c='sudo vim ~/.config/i3/config'
source /usr/local/lib/bazel/bin/bazel-complete.bash
export LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/extras/CUPTI/lib64
hostname -i
# export PATH=PATH:/home/x4/.local/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment