Cleanup bash setup
This commit is contained in:
parent
cdbd25d335
commit
49e75ded04
5 changed files with 69 additions and 62 deletions
67
bash/.bashrc
67
bash/.bashrc
|
@ -1,73 +1,30 @@
|
||||||
export DOTFILES="/home/jake/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|
||||||
source $DOTFILES/bash/boilerplate.sh
|
source $DOTFILES/bash/boilerplate.sh
|
||||||
source $DOTFILES/bash/catfish.sh
|
source $DOTFILES/bash/catfish.sh
|
||||||
source $DOTFILES/bash/javascript.sh
|
source $DOTFILES/bash/javascript.sh
|
||||||
|
|
||||||
|
if [ -f "$(command -v lsb_release)" ]; then
|
||||||
# Load Programs
|
source $DOTFILES/bash/ubuntu.sh # Ubuntu only stuff
|
||||||
export NVM_DIR="/home/jake/.nvm"
|
elif [ -f "$(command -v pacman)" ]; then
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # Load on ubuntu
|
source $DOTFILES/bash/arch.sh # Arch only stuff
|
||||||
|
fi
|
||||||
eval $(thefuck --alias)
|
|
||||||
|
|
||||||
export PATH="/home/jake/.pyenv/bin:$PATH"
|
|
||||||
eval "$(pyenv init -)"
|
|
||||||
eval "$(pyenv virtualenv-init -)"
|
|
||||||
|
|
||||||
|
|
||||||
# Export some variables
|
# Export some variables
|
||||||
export ANDROID_HOME=/opt/android-sdk
|
export ANDROID_HOME=/opt/android-sdk
|
||||||
|
export EDITOR=/bin/nano
|
||||||
|
|
||||||
# Extend PATH
|
# Extend path
|
||||||
export PATH=${PATH}:${ANDROID_HOME}/tools
|
export PATH=${PATH}:${ANDROID_HOME}/tools
|
||||||
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
|
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
|
||||||
export PATH=${PATH}:/opt/genymobile/genymotion
|
export PATH=${PATH}:/opt/genymobile/genymotion
|
||||||
export PATH=/home/jake/.dotfiles/bin:${PATH}
|
export PATH=${HOME}/.dotfiles/bin:${PATH}
|
||||||
|
|
||||||
# Export Java home on ubuntu
|
|
||||||
if [ -f "$(command -v lsb_release)" ]; then
|
|
||||||
JAVA_HOME=/usr/local/java/jdk1.8.0_73
|
|
||||||
export PATH=${PATH}:$JAVA_HOME/bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# bash aliases
|
# bash aliases
|
||||||
alias src="source ~/.bashrc"
|
alias src="source ~/.bashrc"
|
||||||
alias refresh="cd $PWD > /dev/null"
|
alias refresh="cd $PWD > /dev/null"
|
||||||
alias c="clear"
|
alias c="clear"
|
||||||
alias yolo="yaourt -Syau"
|
alias cls="clear"
|
||||||
export EDITOR=/bin/nano
|
alias e="exit"
|
||||||
|
|
||||||
# git aliases
|
|
||||||
alias gs="git status"
|
|
||||||
alias gd="git diff"
|
|
||||||
gh() {
|
|
||||||
if [ $# -eq 1 ]; then
|
|
||||||
command git clone git@github.com:RealOrangeOne/${1}
|
|
||||||
else
|
|
||||||
command git clone git@github.com:${1}/${2}
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Gnome
|
|
||||||
gd-lock() {
|
|
||||||
sessionid=`/bin/loginctl list-sessions | grep jake | awk '{print $1}'`
|
|
||||||
/bin/loginctl lock-session $sessionid
|
|
||||||
}
|
|
||||||
gd-unlock() {
|
|
||||||
sessionid=`/bin/loginctl list-sessions | grep jake | awk '{print $1}'`
|
|
||||||
/bin/loginctl unlock-session $sessionid
|
|
||||||
}
|
|
||||||
alias gdl="gd-lock"
|
|
||||||
alias gdu="gd-unlock"
|
|
||||||
|
|
||||||
|
|
||||||
# miscellaneous software aliases
|
|
||||||
alias y="yoga"
|
|
||||||
alias ym="yoga mode"
|
|
||||||
alias serve="python2 -m SimpleHTTPServer"
|
|
||||||
alias make-dotfiles="cd ~/.dotfiles/ && make && cd - > /dev/null"
|
|
||||||
alias edit-dotfiles="atom ~/.dotfiles/"
|
|
||||||
alias please="sudo"
|
alias please="sudo"
|
||||||
|
alias no="yes n"
|
||||||
|
|
43
bash/applications.sh
Normal file
43
bash/applications.sh
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
# Load Programs
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # load
|
||||||
|
|
||||||
|
eval $(thefuck --alias)
|
||||||
|
|
||||||
|
# export PATH="$HOME/.pyenv/bin:$PATH"
|
||||||
|
# eval "$(pyenv init -)"
|
||||||
|
# eval "$(pyenv virtualenv-init -)"
|
||||||
|
|
||||||
|
|
||||||
|
# git aliases
|
||||||
|
alias gs="git status"
|
||||||
|
alias gd="git diff"
|
||||||
|
gh() {
|
||||||
|
if [ $# -eq 1 ]; then
|
||||||
|
command git clone git@github.com:RealOrangeOne/${1} && cd ${1}
|
||||||
|
else
|
||||||
|
command git clone git@github.com:${1}/${2} && cd ${2}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Gnome
|
||||||
|
gd-lock() {
|
||||||
|
sessionid=`loginctl list-sessions | grep $USER | awk '{print $1}'`
|
||||||
|
loginctl lock-session $sessionid
|
||||||
|
}
|
||||||
|
gd-unlock() {
|
||||||
|
sessionid=`loginctl list-sessions | grep $USER | awk '{print $1}'`
|
||||||
|
loginctl unlock-session $sessionid
|
||||||
|
}
|
||||||
|
alias gdl="gd-lock"
|
||||||
|
alias gdu="gd-unlock"
|
||||||
|
|
||||||
|
alias y="yoga"
|
||||||
|
alias ym="yoga mode"
|
||||||
|
|
||||||
|
|
||||||
|
# miscellaneous software aliases
|
||||||
|
alias serve="python2 -m SimpleHTTPServer"
|
||||||
|
alias make-dotfiles="cd ~/.dotfiles/ && make && cd - > /dev/null"
|
||||||
|
alias edit-dotfiles="atom ~/.dotfiles/"
|
1
bash/arch.sh
Normal file
1
bash/arch.sh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
alias yolo="yaourt -Syau --noconfirm"
|
|
@ -1,19 +1,20 @@
|
||||||
|
alias ctpr="echo ctf project run --" # shortcut helper for ctp
|
||||||
|
|
||||||
ctp() {
|
ctp() {
|
||||||
if [[ $1 == "shell" ]]; then
|
if [[ $1 == "shell" ]]; then
|
||||||
command ctf project run manage.py shell
|
ctpr manage.py shell
|
||||||
elif [[ $1 == "build" ]]; then
|
elif [[ $1 == "build" ]]; then
|
||||||
command ctf project run build
|
ctpr build
|
||||||
elif [ $1 == "test" ] || [ $1 == "t" ]; then
|
elif [ $1 == "test" ] || [ $1 == "t" ]; then
|
||||||
command ctf project run -- runtests ${@:2}
|
ctpr runtests ${@:2}
|
||||||
elif [[ $1 == "run" ]]; then
|
elif [[ $1 == "run" ]]; then
|
||||||
command ctf project run -- ${@:2}
|
ctpr ${@:2}
|
||||||
elif [[ $1 == "manage" ]]; then
|
elif [[ $1 == "manage" ]]; then
|
||||||
command ctf project run -- manage.py ${@:2}
|
ctpr manage.py ${@:2}
|
||||||
elif [[ $1 == "migrate" ]]; then
|
elif [[ $1 == "migrate" ]]; then
|
||||||
command ctf project run -- manage.py migrate ${@:2}
|
ctpr manage.py migrate ${@:2}
|
||||||
elif [[ $1 == "makemigrations" ]]; then
|
elif [[ $1 == "makemigrations" ]]; then
|
||||||
command ctf project run -- manage.py makemigrations ${@:2}
|
ctpr manage.py makemigrations ${@:2}
|
||||||
elif [[ $1 == "route" ]]; then
|
elif [[ $1 == "route" ]]; then
|
||||||
command ctf router ${PWD##*/}.ctf.sh --ident ${PWD##*/}:development:web
|
command ctf router ${PWD##*/}.ctf.sh --ident ${PWD##*/}:development:web
|
||||||
else
|
else
|
||||||
|
|
5
bash/ubuntu.sh
Normal file
5
bash/ubuntu.sh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export JAVA_HOME=/usr/local/java/jdk1.8.0_73
|
||||||
|
export PATH=${PATH}:$JAVA_HOME/bin
|
||||||
|
|
||||||
|
|
||||||
|
alias yolo="sudo apt update && sudo apt upgrade -y"
|
Loading…
Reference in a new issue