Skip to content

Instantly share code, notes, and snippets.

@ridingintraffic
Created December 2, 2018 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ridingintraffic/41c0414ec65a89ace2e22071cc989d88 to your computer and use it in GitHub Desktop.
Save ridingintraffic/41c0414ec65a89ace2e22071cc989d88 to your computer and use it in GitHub Desktop.
dotFileSetup.sh
#!/bin/bash
# Hi im a penguin
if [ "Linux" = "$(uname -a | awk '{printf $1}')" ]
then
#create symlinks
#root because kali
if [ "root" = "$(whoami)" ]
then
# username agnostic because hardcoding anything is annoying
ln -s "$(pwd)"/.tmux.conf /"$(whoami)"/.tmux.conf
ln -s "$(pwd)"/.vimrc /"$(whoami)"/.vimrc
ln -s "$(pwd)"/.bashrc /"$(whoami)"/.bashrc
ln -s "$(pwd)"/.gitconfig /"$(whoami)"/.gitconfig
#not root like a sane person
else
ln -s "$(pwd)"/.tmux.conf /home/"$(whoami)"/.tmux.conf
ln -s "$(pwd)"/.vimrc /home/"$(whoami)"/.vimrc
ln -s "$(pwd)"/.bashrc /home/"$(whoami)"/.bashrc
ln -s "$(pwd)"/.gitconfig /home/"$(whoami)"/.gitconfig
fi
#install latest ripgrep
rg_tag=$(curl --silent "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" |grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' )
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/"$rg_tag"/ripgrep_"$rg_tag"_amd64.deb
sudo dpkg -i ripgrep_"$rg_tag"_amd64.deb
rm ripgrep_"$rg_tag"_amd64.deb
fi
# hi I'm a mac
if [ "Mac" = "$(sw_vers|grep ProductName |awk '{printf $2}')" ]
then
ln -s "$(pwd)"/.tmux.conf /Users/"$(whoami)"/.tmux.conf
ln -s "$(pwd)"/.vimrc /Users/"$(whoami)"/.vimrc
ln -s "$(pwd)"/.bash_profile /Users/"$(whoami)"/.bash_profile
ln -s "$(pwd)"/.gitconfig /Users/"$(whoami)"/.gitconfig
brew install ripgrep
brew install ranger
fi
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment