Finished cleanup

This commit is contained in:
Thomas Lovén 2017-10-14 22:52:13 +02:00
parent ee2a05a99a
commit 99c7cc50a8
6 changed files with 35 additions and 25 deletions

View File

@ -1,21 +1,26 @@
#!/usr/bin/env bash #!/usr/bin/env bash
function setup_fish() function main()
{ {
# Install fish shell
if ! brew list | grep fish >/dev/null; then
brew install fish brew install fish
fi
# Add to list of shells and set as default
if ! grep /usr/local/bin/fish < /etc/shells >/dev/null; then if ! grep /usr/local/bin/fish < /etc/shells >/dev/null; then
echo /usr/local/bin/fish | sudo tee -a /etc/shells echo /usr/local/bin/fish | sudo tee -a /etc/shells
chsh -s /usr/local/bin/fish chsh -s /usr/local/bin/fish
fi fi
}
function link_config() # Install configuration files
{ if [ ! -d ${HOME}/.config ]; then
mkdir ${HOME}/.config mkdir ${HOME}/.config
fi
if [ ! -e ${HOME}/.config/fish ]; then
rm -rf ${HOME}/.config/fish
ln -s ${DOTFILES}/fish ${HOME}/.config/. ln -s ${DOTFILES}/fish ${HOME}/.config/.
fi
} }
main "$@"
export DOTFILES=/Users/thomas/dotfiles
setup_fish
link_config

View File

@ -1,16 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
function setup_git() function main()
{ {
if ! brew list | grep git >/dev/null; then
brew install git brew install git
fi
if [ ! -f "${HOME}/.gitconfig" ]; then
cat << EOF > ${HOME}/.gitconfig cat << EOF > ${HOME}/.gitconfig
[include] [include]
path = ${DOTFILES}/git/gitconfig path = ${DOTFILES}/git/gitconfig
[core] [core]
excludesfile = ${DOTFILES}/git/gitignore_global excludesfile = ${DOTFILES}/git/gitignore_global
EOF EOF
fi
} }
export DOTFILES=/Users/thomas/dotfiles main "$@"
setup_git

View File

@ -41,8 +41,8 @@ function setup_kitty()
export DOTFILES=/Users/thomas/dotfiles export DOTFILES=/Users/thomas/dotfiles
#ssh/setup.sh ssh/setup.sh
#git/setup.sh git/setup.sh
NAS_mounts/setup.sh NAS_mounts/setup.sh
#fish/setup.sh fish/setup.sh
wm/setup.sh wm/setup.sh

View File

@ -1,13 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
function setup_ssh() function main()
{ {
# copy private key to .ssh # copy private key to .ssh
# cp ${KEYFILE} ~/.ssh/thomas_rsa # cp ${KEYFILE} ~/.ssh/thomas_rsa
# chmod 400 ~/.ssh/thomas_rsa # chmod 400 ~/.ssh/thomas_rsa
# ssh-add -K ~/.ssh/thomas_rsa # ssh-add -K ~/.ssh/thomas_rsa
ln -s ${DOTFILES}/ssh/ssh_config ${HOME}/.ssh/config if [ ! -e ${HOME}/.ssh/config ]; then
rm -f ${HOME}/.ssh/config
ln -s ${DOTFILES}/ssh/config ${HOME}/.ssh/config
fi
} }
export DOTFILES=/Users/thomas/dotfiles main "$@"
setup_ssh

View File

@ -23,4 +23,4 @@ function main()
fi fi
} }
main main "$@"