2014-08-11 01:09:13 -04:00
|
|
|
export ZSH=$HOME/.oh-my-zsh
|
|
|
|
ZSH_THEME="af-magic"
|
|
|
|
# Uncomment the following line to enable command auto-correction.
|
2014-09-12 19:03:40 -04:00
|
|
|
# ENABLE_CORRECTION="true"
|
2014-08-29 09:46:43 -04:00
|
|
|
COMPLETION_WAITING_DOTS="true"
|
2014-08-11 01:09:13 -04:00
|
|
|
# Uncomment the following line if you want to change the command execution time
|
|
|
|
# stamp shown in the history command output.
|
|
|
|
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
2014-08-29 09:46:43 -04:00
|
|
|
HIST_STAMPS="dd/mm/yyyy"
|
|
|
|
setopt APPEND_HISTORY
|
|
|
|
HISTSIZE=12000
|
|
|
|
SAVEHIST=10000000
|
|
|
|
setopt HIST_EXPIRE_DUPS_FIRST
|
|
|
|
setopt EXTENDED_HISTORY
|
2014-12-27 04:35:51 -05:00
|
|
|
# export PAGER=/usr/bin/w3m
|
2014-08-29 09:46:43 -04:00
|
|
|
alias less=$PAGER
|
2014-09-26 20:58:02 -04:00
|
|
|
source "$HOME/.antigen/antigen.zsh"
|
|
|
|
antigen bundle stonewareslord/oh-my-git
|
2014-10-05 15:30:26 -04:00
|
|
|
#antigen bundle arialdomartini/oh-my-git
|
2014-09-26 20:58:02 -04:00
|
|
|
antigen use oh-my-zsh
|
|
|
|
antigen theme stonewareslord/oh-my-git-themes af-magic
|
2014-11-16 11:08:35 -05:00
|
|
|
antigen bundle stonewareslord/liquidprompt
|
2014-09-26 20:58:02 -04:00
|
|
|
antigen apply
|
|
|
|
|
2014-08-11 01:09:13 -04:00
|
|
|
# Would you like to use another custom folder than $ZSH/custom?
|
|
|
|
# ZSH_CUSTOM=/path/to/new-custom-folder
|
2014-09-12 19:03:40 -04:00
|
|
|
#plugins=(git)
|
2014-09-23 18:10:30 -04:00
|
|
|
DISABLE_AUTO_UPDATE="true"
|
2014-09-26 20:58:02 -04:00
|
|
|
#source $ZSH/oh-my-zsh.sh
|
2014-10-14 16:15:59 -04:00
|
|
|
if [ -f /etc/zsh_command_not_found ] ; then
|
|
|
|
source /etc/zsh_command_not_found
|
|
|
|
fi
|
2014-08-11 01:09:13 -04:00
|
|
|
export PATH="/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
|
2014-08-29 09:46:43 -04:00
|
|
|
export EDITOR='vim'
|
2014-10-19 14:06:31 -04:00
|
|
|
if [ "$(uname)" != "Darwin" ]; then
|
|
|
|
alias ls='ls --color=always -F'
|
|
|
|
fi
|
2014-12-27 04:35:51 -05:00
|
|
|
alias steam='sudo kill -9 `pidof steam`;sudo unshare -n -- sh -c "ifconfig lo up;sudo -u stonewareslord i3-msg \"workspace3;exec steam\"" > /dev/null 2>&1 & disown'
|
2014-12-07 13:52:33 -05:00
|
|
|
alias matlab='matlab -glnx86'
|
2014-11-22 19:14:54 -05:00
|
|
|
alias srm='srm -dv'
|
2014-11-16 11:08:35 -05:00
|
|
|
alias pass='DISPLAY= pass'
|
2014-10-05 15:30:26 -04:00
|
|
|
alias ehistory='cat ~/.bash_eternal_history|egrep -iP $@'
|
2014-08-11 01:09:13 -04:00
|
|
|
alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
|
|
|
|
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
|
|
|
alias disphost='export DISPLAY=:0.0'
|
|
|
|
alias ll='ls -alF'
|
|
|
|
alias la='ls -A'
|
|
|
|
alias l='ls -CF'
|
|
|
|
alias logout='sudo pkill -u $USER'
|
|
|
|
alias fixsh='ssh-keygen -R'
|
|
|
|
alias tmux='tmux -2'
|
2014-08-29 09:46:43 -04:00
|
|
|
#alias less='less -r'
|
2014-08-11 01:09:13 -04:00
|
|
|
alias tree='tree -C'
|
2014-10-14 16:15:59 -04:00
|
|
|
#alias grep="egrep -i --color=auto"
|
2014-08-11 01:09:13 -04:00
|
|
|
alias skim="(head -5; tail -5) <"
|
2014-12-27 04:35:51 -05:00
|
|
|
alias cp="rsync -ha --info=progress2"
|
2014-08-11 01:09:13 -04:00
|
|
|
alias mv="mv -v"
|
2014-12-27 04:35:51 -05:00
|
|
|
alias m="mv"
|
|
|
|
alias c="cp"
|
2014-08-11 01:09:13 -04:00
|
|
|
alias la='ls -lah $LS_COLOR'
|
|
|
|
alias dt='date "+%F %T"'
|
|
|
|
alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done'
|
2014-09-20 23:09:59 -04:00
|
|
|
alias adk='/home/stonewareslord/Applications/adk/bin/studio.sh & disown'
|
2014-08-11 01:09:13 -04:00
|
|
|
alias resource='. ~/.zshrc'
|
2014-12-27 04:35:51 -05:00
|
|
|
alias install='sudo apt-get --show-progress install'
|
2014-08-11 01:09:13 -04:00
|
|
|
alias search='apt-cache search'
|
2014-12-27 04:35:51 -05:00
|
|
|
alias remove='sudo apt-get --show-progress remove'
|
2014-08-11 01:09:13 -04:00
|
|
|
alias update='sudo apt-get update'
|
2014-12-27 04:35:51 -05:00
|
|
|
alias upgrade='sudo apt-get --show-progress upgrade'
|
|
|
|
alias autoremove='sudo apt-get --show-progress autoremove'
|
2014-08-11 01:09:13 -04:00
|
|
|
alias ..='k ..'
|
|
|
|
alias ...='k ../..'
|
|
|
|
alias ....='k ../../..'
|
|
|
|
alias .....='k ../../../..'
|
|
|
|
alias ......='k ../../../../..'
|
|
|
|
alias .......='k ../../../../../..'
|
|
|
|
alias ........='k ../../../../../../..'
|
|
|
|
alias .........='k ../../../../../../../..'
|
|
|
|
alias ..........='k ../../../../../../../../..'
|
|
|
|
alias ...........='k ../../../../../../../../../..'
|
|
|
|
alias ............='k ../../../../../../../../../../..'
|
|
|
|
alias .............='k ../../../../../../../../../../../..'
|
|
|
|
alias ..............='k ../../../../../../../../../../../../..'
|
|
|
|
alias ...............='k ../../../../../../../../../../../../../..'
|
|
|
|
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
|
|
|
alias tux="wemux"
|
|
|
|
alias rmgit="git remote rm origin;git remote rm https;git remote rm oOrigin;git remote rm oHttps"
|
2014-08-29 09:46:43 -04:00
|
|
|
alias rname="while true;do echo -n \"Rename: \";read A;echo -n \"To: \";read B;i3-msg 'rename workspace $A to $B';done"
|
2014-08-11 01:09:13 -04:00
|
|
|
alias g="git $@"
|
2014-08-29 09:46:43 -04:00
|
|
|
alias echip="curl ifconfig.me"
|
|
|
|
alias vpn="cd ~/.openvpn;sudo openvpn config.ovpn;cd -"
|
2014-09-07 11:06:54 -04:00
|
|
|
alias to="~/.todo/todo.sh"
|
2014-09-12 19:03:40 -04:00
|
|
|
alias stdns="sudo sh -c 'echo \"nameserver 8.8.8.8\\nnameserver 8.8.4.4\" > /etc/resolv.conf'"
|
2014-11-22 19:14:54 -05:00
|
|
|
alias fvim="vim -u NONE +\"so ~/.vim/plugged/flappyvird-vim/plugin/flappyvird.vim\" +\"so ~/.vim/plugged/flappyvird-vim/autoload/flappyvird.vim\" +\":FlappyVird\" +\":q\""
|
2014-09-28 11:45:17 -04:00
|
|
|
alias fk='k `fzf --no-mouse -m -1 -x`'
|
|
|
|
alias fh='eval $(([ -n "$ZSH_NAME" ] && fc --no-mouse -m -1 -x -l 1 || history) | fzf +s | sed "s/ *[0-9]* *//")'
|
|
|
|
alias fkill='ps -ef | sed 1d | fzf --no-mouse -m -1 -x | awk "{print $2}" | xargs kill -${1:-9}'
|
2014-11-16 11:08:35 -05:00
|
|
|
alias slp='smon ./x&DISPLAY=:0.0 i3lock -di `echo $(shuf -n1 -e ~/.i3/wall/*) | tee /tmp/wall`'
|
2014-08-19 13:20:34 -04:00
|
|
|
alias -s html="firefox"
|
|
|
|
alias -s log="less -MN"
|
2014-10-14 16:15:59 -04:00
|
|
|
alias -s odt="libreoffice"
|
|
|
|
alias -s doc="libreoffice"
|
|
|
|
alias -s docx="libreoffice"
|
2014-09-28 11:45:17 -04:00
|
|
|
alias -g F='`fzf --no-mouse -m -1 -x`'
|
2014-08-23 22:33:15 -04:00
|
|
|
alias -g nify=" > /dev/null 2>&1 &"
|
2014-09-23 18:10:30 -04:00
|
|
|
alias -g nifyd=" > /dev/null 2>&1 & disown"
|
2014-08-30 15:59:01 -04:00
|
|
|
alias -g G='|& egrep -i'
|
2014-09-12 19:03:40 -04:00
|
|
|
alias -g AW='austenwares.com'
|
2014-09-28 11:45:17 -04:00
|
|
|
export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
|
2014-12-27 04:35:51 -05:00
|
|
|
function offline(){
|
|
|
|
echo unshare -n -- sh -c "sudo -u stonewareslord zsh -c '$@'"
|
|
|
|
sudo unshare -n -- sh -c "sudo -u stonewareslord zsh -c '$@'"
|
|
|
|
}
|
2014-11-07 21:25:46 -05:00
|
|
|
function smon(){
|
2014-11-08 12:34:11 -05:00
|
|
|
timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207 "$@"
|
2014-11-07 21:25:46 -05:00
|
|
|
}
|
2014-08-29 09:46:43 -04:00
|
|
|
function dnstest(){
|
2014-11-22 19:14:54 -05:00
|
|
|
echo "resolv.conf:"
|
|
|
|
cat /etc/resolv.conf
|
2014-12-07 13:52:33 -05:00
|
|
|
echo "Testing DNS:"
|
|
|
|
dig google.com
|
2014-08-29 09:46:43 -04:00
|
|
|
echo "Testing ping:"
|
2014-09-23 18:10:30 -04:00
|
|
|
ping -c 2 8.8.8.8
|
2014-08-29 09:46:43 -04:00
|
|
|
echo "Testing IP curl:"
|
2014-12-07 13:52:33 -05:00
|
|
|
curl -k http://98.26.78.121/b/
|
2014-11-22 19:14:54 -05:00
|
|
|
echo
|
2014-08-29 09:46:43 -04:00
|
|
|
echo "Testing DNS"
|
2014-09-20 23:09:10 -04:00
|
|
|
curl ifconfig.me
|
2014-08-29 09:46:43 -04:00
|
|
|
}
|
2014-08-11 01:09:13 -04:00
|
|
|
function cinitify(){
|
|
|
|
mkdir $2
|
|
|
|
cd $2
|
|
|
|
git init
|
|
|
|
git remote add origin git@austenwares.com:$1/$2.git
|
|
|
|
git remote add https https://austenwares.com/gitlab/$1/$2.git
|
|
|
|
#Offline mode
|
|
|
|
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
|
|
|
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
|
|
|
git remote -v
|
2014-08-12 15:18:54 -04:00
|
|
|
git config http.sslVerify false
|
2014-08-11 01:09:13 -04:00
|
|
|
if [[ ! $3 == "-r" ]] ; then
|
|
|
|
echo -n "Pull from: "
|
|
|
|
read from
|
|
|
|
git pull $from
|
|
|
|
git checkout master
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function initify(){
|
|
|
|
git init
|
|
|
|
git remote add origin git@austenwares.com:$1/$2.git
|
|
|
|
git remote add https https://austenwares.com/gitlab/$1/$2.git
|
|
|
|
#Offline mode
|
|
|
|
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
|
|
|
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
|
|
|
git remote -v
|
2014-08-12 15:18:54 -04:00
|
|
|
git config http.sslVerify false
|
2014-08-11 01:09:13 -04:00
|
|
|
if [[ ! $3 == "-r" ]] ; then
|
|
|
|
echo -n "Pull from: "
|
|
|
|
read from
|
|
|
|
git pull $from
|
|
|
|
git checkout master
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function ovim(){ vim +"SessionOpen $@"; }
|
|
|
|
function ogvim(){ gvim +"SessionOpen $@"; }
|
|
|
|
function tsh(){
|
|
|
|
ssh $* -X
|
|
|
|
if which ponysay >/dev/null; then
|
|
|
|
ponysay "Connection closed!"
|
|
|
|
else
|
|
|
|
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function k(){
|
|
|
|
if [[ $# > 1 ]] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#More than 1 arguement
|
|
|
|
echo -n "Exec [mcvxX]: "
|
|
|
|
read a
|
|
|
|
if [[ $a == "m" ]] ; then
|
|
|
|
mv $@
|
|
|
|
elif [[ $a == "c" ]] ; then
|
|
|
|
cp $@
|
|
|
|
elif [[ $a == "v" ]] ; then
|
|
|
|
vim $@
|
|
|
|
elif [[ $a == "x" ]] ; then
|
|
|
|
rm "$@"
|
|
|
|
elif [[ $a == "XX" ]] ; then
|
|
|
|
rm -rf "$@"
|
|
|
|
fi
|
2014-08-11 01:09:13 -04:00
|
|
|
elif [ -d "$@" ] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#cd then ls
|
2014-08-11 01:09:13 -04:00
|
|
|
cd "$@" && ls
|
2014-08-11 15:14:46 -04:00
|
|
|
elif [[ "$@" == "-" ]] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#Because if this isn't here, k - won't work
|
2014-08-11 01:09:13 -04:00
|
|
|
cd - && ls
|
|
|
|
elif [ -f "$@" ] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#Extract if it's extractable
|
2014-08-11 01:09:13 -04:00
|
|
|
case $1 in
|
|
|
|
*.tar.xz) tar xvf $1 ;;
|
|
|
|
*.tar.bz2) tar xvjf $1 ;;
|
|
|
|
*.tar.gz) tar xvzf $1 ;;
|
|
|
|
*.bz2) bunzip2 $1 ;;
|
|
|
|
*.rar) rar x $1 ;;
|
|
|
|
*.gz) gunzip $1 ;;
|
|
|
|
*.tar) tar xvf $1 ;;
|
|
|
|
*.tbz2) tar xvjf $1 ;;
|
|
|
|
*.tgz) tar xvzf $1 ;;
|
|
|
|
*.zip) unzip $1 ;;
|
|
|
|
*.Z) uncompress $1 ;;
|
|
|
|
*.7z) 7z x $1 ;;
|
|
|
|
*) vim $1
|
|
|
|
esac
|
|
|
|
else
|
2014-08-30 15:59:01 -04:00
|
|
|
echo -n "Exec [dcvfxX]: "
|
2014-08-11 01:09:13 -04:00
|
|
|
read a
|
2014-08-18 20:06:49 -04:00
|
|
|
if [[ $a == "d" ]] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#Create directory
|
2014-08-18 20:06:49 -04:00
|
|
|
mkdir $@
|
|
|
|
elif [[ $a == "c" ]] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#Create directory and cd into it
|
2014-08-18 20:06:49 -04:00
|
|
|
mkdir $@
|
|
|
|
cd $@
|
2014-08-30 15:59:01 -04:00
|
|
|
elif [[ $a == "v" ]] ; then
|
|
|
|
#Edit with vim
|
2014-08-11 01:09:13 -04:00
|
|
|
vim "$@"
|
2014-08-18 20:06:49 -04:00
|
|
|
elif [[ $a == "f" ]] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#Open with Firefox
|
2014-08-18 20:06:49 -04:00
|
|
|
firefox "$@"
|
|
|
|
elif [[ $a == "x" ]] ; then
|
2014-08-30 15:59:01 -04:00
|
|
|
#rm file
|
2014-08-18 20:06:49 -04:00
|
|
|
rm "$@"
|
2014-08-30 15:59:01 -04:00
|
|
|
elif [[ $a == "X" ]] ; then
|
|
|
|
#rm directory
|
2014-08-18 20:06:49 -04:00
|
|
|
rmdir "$@"
|
2014-08-30 15:59:01 -04:00
|
|
|
elif [[ $a == "XX" ]] ; then
|
|
|
|
#rm -rf everything
|
|
|
|
rm -rf "$@"
|
2014-08-11 01:09:13 -04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
2014-09-23 18:10:30 -04:00
|
|
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|