Cleanup bash setup

This commit is contained in:
Jake Howard 2016-11-07 20:57:18 +00:00
parent cdbd25d335
commit 49e75ded04
5 changed files with 69 additions and 62 deletions

View File

@ -1,73 +1,30 @@
export DOTFILES="/home/jake/.dotfiles"
export DOTFILES="$HOME/.dotfiles"
source $DOTFILES/bash/boilerplate.sh
source $DOTFILES/bash/catfish.sh
source $DOTFILES/bash/javascript.sh
# Load Programs
export NVM_DIR="/home/jake/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # Load on ubuntu
eval $(thefuck --alias)
export PATH="/home/jake/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
if [ -f "$(command -v lsb_release)" ]; then
source $DOTFILES/bash/ubuntu.sh # Ubuntu only stuff
elif [ -f "$(command -v pacman)" ]; then
source $DOTFILES/bash/arch.sh # Arch only stuff
fi
# Export some variables
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}/platform-tools
export PATH=${PATH}:/opt/genymobile/genymotion
export PATH=/home/jake/.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
export PATH=${HOME}/.dotfiles/bin:${PATH}
# bash aliases
alias src="source ~/.bashrc"
alias refresh="cd $PWD > /dev/null"
alias c="clear"
alias yolo="yaourt -Syau"
export EDITOR=/bin/nano
# 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 cls="clear"
alias e="exit"
alias please="sudo"
alias no="yes n"

43
bash/applications.sh Normal file
View 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
View File

@ -0,0 +1 @@
alias yolo="yaourt -Syau --noconfirm"

View File

@ -1,19 +1,20 @@
alias ctpr="echo ctf project run --" # shortcut helper for ctp
ctp() {
if [[ $1 == "shell" ]]; then
command ctf project run manage.py shell
ctpr manage.py shell
elif [[ $1 == "build" ]]; then
command ctf project run build
ctpr build
elif [ $1 == "test" ] || [ $1 == "t" ]; then
command ctf project run -- runtests ${@:2}
ctpr runtests ${@:2}
elif [[ $1 == "run" ]]; then
command ctf project run -- ${@:2}
ctpr ${@:2}
elif [[ $1 == "manage" ]]; then
command ctf project run -- manage.py ${@:2}
ctpr manage.py ${@:2}
elif [[ $1 == "migrate" ]]; then
command ctf project run -- manage.py migrate ${@:2}
ctpr manage.py migrate ${@:2}
elif [[ $1 == "makemigrations" ]]; then
command ctf project run -- manage.py makemigrations ${@:2}
ctpr manage.py makemigrations ${@:2}
elif [[ $1 == "route" ]]; then
command ctf router ${PWD##*/}.ctf.sh --ident ${PWD##*/}:development:web
else

5
bash/ubuntu.sh Normal file
View 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"