2012-04-04 22:42:24 +00:00
|
|
|
#!/usr/bin/env bash
|
2012-03-29 17:02:14 +00:00
|
|
|
|
2013-08-02 21:38:38 +00:00
|
|
|
# Basic requirements - bash, git
|
2012-03-29 17:02:14 +00:00
|
|
|
|
|
|
|
# a die function as always
|
|
|
|
die() {
|
|
|
|
printf '%s\n' "$@" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Some variable(s)
|
|
|
|
|
2012-06-16 18:40:12 +00:00
|
|
|
repo="git://github.com/staticsafe/dotfiles.git"
|
2012-03-29 17:02:14 +00:00
|
|
|
|
|
|
|
# Lets get this party on the road, shall we?
|
|
|
|
|
2013-08-02 21:38:38 +00:00
|
|
|
gitcheck() {
|
|
|
|
hash git &>/dev/null || die 'git does not exist, exiting'
|
|
|
|
printf '%s\n' "git check : PASSED"
|
2012-03-29 17:02:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
changeshell() {
|
2012-07-26 02:40:00 +00:00
|
|
|
if [[ $SHELL == $(command -v zsh) ]]; then
|
2012-03-29 17:02:14 +00:00
|
|
|
printf '%s\n' "Your default shell is already zsh, continuing."
|
|
|
|
else
|
2012-07-26 02:40:00 +00:00
|
|
|
chsh -s $(command -v zsh)
|
2012-03-29 17:19:13 +00:00
|
|
|
printf '%s\n' "Default shell changed to zsh, logout and login to see changes"
|
2012-03-29 17:02:14 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
linkfiles() {
|
2012-03-29 17:19:13 +00:00
|
|
|
#find ~/dev/dotfiles -type f -name ".*" -execdir ln -s -f {}
|
|
|
|
# --target-directory=$HOME \; # removed until I can figure out the issue
|
2013-08-02 21:38:38 +00:00
|
|
|
ln -sf ~/dotfiles/.zshrc $HOME/
|
|
|
|
ln -sf ~/dotfiles/.vimrc $HOME/
|
|
|
|
ln -sf ~/dotfiles/.tmux.conf $HOME/
|
|
|
|
ln -sf ~/dotfiles/.conkyrc $HOME/
|
|
|
|
ln -sf ~/dotfiles/.zsh $HOME/
|
|
|
|
ln -sf ~/dotfiles/.vim $HOME/
|
2012-03-29 17:02:14 +00:00
|
|
|
touch ~/.zhistory
|
|
|
|
}
|
|
|
|
|
|
|
|
getdotfiles() {
|
2013-08-02 21:38:38 +00:00
|
|
|
if [[ -d ~/dotfiles ]]; then
|
|
|
|
cd ~/dotfiles
|
2012-03-29 17:02:14 +00:00
|
|
|
git pull
|
|
|
|
linkfiles
|
|
|
|
else
|
2013-08-02 21:38:38 +00:00
|
|
|
cd
|
2012-03-29 17:02:14 +00:00
|
|
|
git clone $repo
|
|
|
|
linkfiles
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-08-02 21:38:38 +00:00
|
|
|
gitcheck
|
2012-03-29 17:02:14 +00:00
|
|
|
changeshell
|
|
|
|
getdotfiles
|
2012-04-10 17:05:44 +00:00
|
|
|
exec zsh
|