Remove scripts
This commit is contained in:
@ -1,36 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# if [[ -n ${ZSH_VERSION-} ]]; then
|
|
||||||
# autoload -U +X bashcompinit && bashcompinit
|
|
||||||
# fi
|
|
||||||
|
|
||||||
_o() {
|
|
||||||
local cur prev sessions
|
|
||||||
|
|
||||||
sessions=$(o params)
|
|
||||||
|
|
||||||
COMPREPLY=()
|
|
||||||
|
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
||||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "${sessions}" -- ${cur}) )
|
|
||||||
}
|
|
||||||
|
|
||||||
complete -o nospace -F _o o
|
|
||||||
|
|
||||||
|
|
||||||
_vims() {
|
|
||||||
local cur prev sessions
|
|
||||||
|
|
||||||
sessions=$(vims sessions)
|
|
||||||
|
|
||||||
COMPREPLY=()
|
|
||||||
|
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
||||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "${sessions}" -- ${cur}) )
|
|
||||||
}
|
|
||||||
|
|
||||||
complete -o nospace -F _vims vims
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
username="mustachiod"
|
|
||||||
|
|
||||||
if [ $# -gt 0 ]; then
|
|
||||||
reponame=$1
|
|
||||||
else
|
|
||||||
echo "Repo name"
|
|
||||||
read reponame
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Password"
|
|
||||||
read -s password
|
|
||||||
|
|
||||||
curl --user $username:$password https://api.bitbucket.org/1.0/repositories/ --data name=$reponame --data is_private='true'
|
|
||||||
git remote add origin git@bitbucket.org:$username/$reponame.git
|
|
||||||
git push -u origin --all
|
|
||||||
git push -u origin --tags
|
|
||||||
107
scripts/gitall
107
scripts/gitall
@ -1,107 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
declare -a directories=(
|
|
||||||
"~/Documents/setup"
|
|
||||||
"~/org"
|
|
||||||
"~/matlab"
|
|
||||||
"~/tex"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
divider="======================================================================="
|
|
||||||
git="/.git"
|
|
||||||
noCommits=0
|
|
||||||
|
|
||||||
if [ $# -gt 0 ]; then
|
|
||||||
if [ $1 == p ]; then
|
|
||||||
flag="p"
|
|
||||||
elif [ $1 == c ]; then
|
|
||||||
flag="c"
|
|
||||||
elif [ $1 == s ]; then
|
|
||||||
flag="s"
|
|
||||||
else
|
|
||||||
echo "wrong flag"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "no arguments"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for dir in "${directories[@]}"
|
|
||||||
do
|
|
||||||
eval gitdir=$dir$git
|
|
||||||
if [[ -d "$gitdir" ]]; then
|
|
||||||
if [ $flag == p ]; then
|
|
||||||
echo -e "\n"$divider
|
|
||||||
echo -e "$dir"
|
|
||||||
echo $divider
|
|
||||||
eval "git -C $dir pull --all"
|
|
||||||
|
|
||||||
elif [ $flag == c ]; then
|
|
||||||
OUTPUT=$(eval git -c color.status=always -C $dir status )
|
|
||||||
noCommit=$(echo $OUTPUT | grep -q "nothing to commit, working directory clean")$?
|
|
||||||
if [[ $noCommit -eq 1 ]]; then
|
|
||||||
echo -e "\n"$divider
|
|
||||||
echo -e "$dir"
|
|
||||||
echo $divider
|
|
||||||
eval "git -C $dir commit -a"
|
|
||||||
noCommits=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ $flag == s ]; then
|
|
||||||
OUTPUT=$(eval git -c color.status=always -C $dir status )
|
|
||||||
noCommit=$(echo $OUTPUT | grep -q "nothing to commit, working directory clean")$?
|
|
||||||
upToDate=$(echo $OUTPUT | grep -q "Your branch is up-to-date")$?
|
|
||||||
isAhead=$(echo $OUTPUT | grep -q "Your branch is ahead")$?
|
|
||||||
hasUntracked=$(echo $OUTPUT | grep -q "Untracked files")$?
|
|
||||||
|
|
||||||
if [[ $upToDate -eq 1 ]] || [[ $noCommit -eq 1 ]]; then
|
|
||||||
noCommits=1
|
|
||||||
echo -e "\n"$divider
|
|
||||||
echo "$dir"
|
|
||||||
echo $divider
|
|
||||||
echo "$OUTPUT"
|
|
||||||
|
|
||||||
if [[ $isAhead -eq 0 ]]; then
|
|
||||||
echo "Push changes to origin? [Y/n]"
|
|
||||||
read answer
|
|
||||||
if [[ $answer == Y ]] || [[ $answer == y ]] || [[ -z "${answer}" ]]; then
|
|
||||||
eval "git -C $dir push"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $hasUntracked -eq 0 ]]; then
|
|
||||||
echo "Add untracked files? [Y/n]"
|
|
||||||
read answer
|
|
||||||
if [[ $answer == Y ]] || [[ $answer == y ]] || [[ -z "${answer}" ]]; then
|
|
||||||
eval "git -C $dir add -A $dir"
|
|
||||||
eval "git -C $dir status"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ ( $flag == s ) && ( $noCommits -eq 1 ) ]]; then
|
|
||||||
echo -e "\n"$divider
|
|
||||||
echo $divider
|
|
||||||
echo "Commit all? [Y/n]"
|
|
||||||
read answer
|
|
||||||
if [[ $answer == Y ]] || [[ $answer == y ]] || [[ -z "${answer}" ]]; then
|
|
||||||
eval "gitall c"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ( $flag == s ) && ( $noCommits -eq 0 ) ]]; then
|
|
||||||
echo -e "\n"$divider
|
|
||||||
echo "nothing to be done"
|
|
||||||
echo $divider
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ( $flag == c ) && ( $noCommits -eq 0 ) ]]; then
|
|
||||||
echo -e "\n"$divider
|
|
||||||
echo "nothing to commit, all done"
|
|
||||||
echo $divider
|
|
||||||
fi
|
|
||||||
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ $# -gt 0 ]; then
|
|
||||||
arg=$1
|
|
||||||
echo "File:" $arg
|
|
||||||
(exec /usr/local/MATLAB/R2016a/bin/glnxa64/mlint $arg)
|
|
||||||
fi
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
|
|
||||||
nvim -d -u ~/.config/nvim/init.vim "$1" "$2"
|
|
||||||
148
scripts/o
148
scripts/o
@ -1,148 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# set -o nounset
|
|
||||||
# set -e
|
|
||||||
|
|
||||||
declare -A sessions=(
|
|
||||||
["misc"]="~/"
|
|
||||||
["qivOld"]="~/dev/projects/P11/workspace/qivserver"
|
|
||||||
["qiv"]="~/dev/projects/qiv/code/java/server"
|
|
||||||
# ["buchi"]="~/dev/projects/P17.02/Code/"
|
|
||||||
# ["bosch"]="~/dev/projects/bosch/Code/port/fredwick/source"
|
|
||||||
)
|
|
||||||
|
|
||||||
vimSessionsDir="~/.config/nvim/obsessions"
|
|
||||||
|
|
||||||
function setup() {
|
|
||||||
local session attach
|
|
||||||
session=$1
|
|
||||||
attach=$2
|
|
||||||
|
|
||||||
if tmux has-session -t $1>/dev/null 2>/dev/null; then
|
|
||||||
if [[ $attach == true ]]; then
|
|
||||||
attachSession $session
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
makeSession $session
|
|
||||||
if [[ $attach == true ]]; then
|
|
||||||
attachSession $session
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function makeSession() {
|
|
||||||
local session dir oldTMUX
|
|
||||||
session=$1
|
|
||||||
dir="${sessions[$session]}"
|
|
||||||
|
|
||||||
if [[ $insideSession == true ]]; then
|
|
||||||
oldTMUX="$TMUX"
|
|
||||||
TMUX=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$session" in
|
|
||||||
misc)
|
|
||||||
tmux new-session -s $session -n bash -d >/dev/null 2>/dev/null
|
|
||||||
tmux send-keys -t $session:0 "cd $dir" C-m
|
|
||||||
tmux send-keys -t $session:0 'clear' C-m
|
|
||||||
tmux selectp -t $session:0
|
|
||||||
tmux splitw -h -p 50
|
|
||||||
tmux selectp -l
|
|
||||||
|
|
||||||
tmux new-window -t $session:1 -n bash
|
|
||||||
tmux send-keys -t $session:1 "cd $dir" C-m
|
|
||||||
tmux send-keys -t $session:1 'clear' C-m
|
|
||||||
;;
|
|
||||||
|
|
||||||
qiv)
|
|
||||||
tmux new-session -s $session -n git -d >/dev/null 2>/dev/null
|
|
||||||
tmux send-keys -t $session:0 "cd $dir" C-m
|
|
||||||
tmux send-keys -t $session:0 'clear' C-m
|
|
||||||
tmux send-keys -t $session:0 'git st' C-m
|
|
||||||
# tmux send-keys -t $session:0 "cd $dir" C-m
|
|
||||||
# tmux send-keys -t $session:0 'clear' C-m
|
|
||||||
# tmux send-keys -t $session:0 "nvim" C-m
|
|
||||||
|
|
||||||
tmux new-window -t $session:1 -n bash
|
|
||||||
;;
|
|
||||||
|
|
||||||
qivOld)
|
|
||||||
tmux new-session -s $session -n git -d >/dev/null 2>/dev/null
|
|
||||||
tmux send-keys -t $session:0 "cd $dir" C-m
|
|
||||||
tmux send-keys -t $session:0 'clear' C-m
|
|
||||||
tmux send-keys -t $session:0 'git st' C-m
|
|
||||||
# tmux send-keys -t $session:0 "cd $dir" C-m
|
|
||||||
# tmux send-keys -t $session:0 'clear' C-m
|
|
||||||
# tmux send-keys -t $session:0 "nvim" C-m
|
|
||||||
|
|
||||||
tmux new-window -t $session:1 -n bash
|
|
||||||
;;
|
|
||||||
|
|
||||||
# bosch)
|
|
||||||
# tmux new-session -s $session -n code -d >/dev/null 2>/dev/null
|
|
||||||
# tmux send-keys -t $session:0 "cd $dir" C-m
|
|
||||||
# tmux send-keys -t $session:0 'clear' C-m
|
|
||||||
# tmux send-keys -t $session:0 "nvim" C-m
|
|
||||||
|
|
||||||
# tmux new-window -t $session:1 -n bash
|
|
||||||
# tmux send-keys -t $session:1 "cd $dir" C-m
|
|
||||||
# tmux send-keys -t $session:1 'clear' C-m
|
|
||||||
# tmux send-keys -t $session:1 'git st' C-m
|
|
||||||
# ;;
|
|
||||||
esac
|
|
||||||
tmux select-window -t $session:0
|
|
||||||
|
|
||||||
if [[ $insideSession == true ]]; then
|
|
||||||
TMUX="$oldTMUX"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function attachSession() {
|
|
||||||
if [[ $insideSession == true ]]; then
|
|
||||||
tmux switch-client -t $1
|
|
||||||
else
|
|
||||||
tmux attach -t $1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if [ $# -gt 0 ]; then
|
|
||||||
arg=$1
|
|
||||||
|
|
||||||
if [[ ! -z ${TMUX:-} ]]; then
|
|
||||||
insideSession=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$arg" in
|
|
||||||
all)
|
|
||||||
for session in "${!sessions[@]}"; do
|
|
||||||
setup $session false
|
|
||||||
done
|
|
||||||
attachSession misc
|
|
||||||
;;
|
|
||||||
|
|
||||||
kill)
|
|
||||||
if [ $# -eq 2 ]; then
|
|
||||||
tmux kill-session -t $2
|
|
||||||
else
|
|
||||||
tmux kill-server && echo "killed all sessions"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
params)
|
|
||||||
parameters="${!sessions[@]} all kill"
|
|
||||||
echo "$parameters"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
if [ ! -z "${sessions[$arg]:-}" ]; then
|
|
||||||
setup $arg true
|
|
||||||
else
|
|
||||||
echo "no such session"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
else
|
|
||||||
setup misc true
|
|
||||||
fi
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
BINDIR="$HOME/bin"
|
|
||||||
|
|
||||||
if [[ ! -d $BINDIR ]]; then
|
|
||||||
mkdir $BINDIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
for scripts in $SCRIPTDIR/*; do
|
|
||||||
script=${scripts##*/}
|
|
||||||
if [[ $script != "setup" ]] && [[ $script != "alarm.msg" ]]; then
|
|
||||||
if [[ ! -a $BINDIR/$script ]]; then
|
|
||||||
ln -s $SCRIPTDIR/$script $BINDIR/$script
|
|
||||||
echo $script "symlinked to" $BINDIR/$script
|
|
||||||
else
|
|
||||||
echo "already exists:" $BINDIR/$script
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
Reference in New Issue
Block a user