diff --git a/README.md b/README.md index 7058289..7379ebb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ My personal configuration files. ##### Usage 1. Clone this repository into `~/.dotfiles` -2. Install Homebrew: https://brew.sh/ -3. Install tools: `brew bundle install` -4. (Optional) Install more tools: `brew bundle install --file=Brewfile.opt` +2. Install [Homebrew](https://brew.sh/): `./install-brew.sh` +3. Install tools: `brew bundle install --file=brew/Brewfile` +4. (Optional) Install more tools: `brew bundle install --file=brew/Brewfile.opt` 5. Install everything else, including symlinks: `./install.sh` diff --git a/.bashrc b/bash/.bashrc similarity index 100% rename from .bashrc rename to bash/.bashrc diff --git a/Brewfile b/brew/Brewfile similarity index 100% rename from Brewfile rename to brew/Brewfile diff --git a/Brewfile.opt b/brew/Brewfile.opt similarity index 100% rename from Brewfile.opt rename to brew/Brewfile.opt diff --git a/fish/config.fish b/fish/config.fish index dcbba09..5f21de0 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -27,7 +27,6 @@ test -d /sbin ; and set -x PATH $PATH /sbin # Aliases alias adventure='emacs -batch -l dunnet' alias afk='pmset displaysleepnow' -alias dnsflush='sudo killall -HUP mDNSResponder' alias java8="set -gx JAVA_HOME $JAVA_HOME_8" alias java11="set -gx JAVA_HOME $JAVA_HOME_11" alias md5sum="md5 -r $argv" diff --git a/fish/fish_variables b/fish/fish_variables index 22e8da6..c0f7d7e 100644 --- a/fish/fish_variables +++ b/fish/fish_variables @@ -7,7 +7,7 @@ SETUVAR fish_color_autosuggestion:969896 SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_command:c397d8 SETUVAR fish_color_comment:e7c547 -SETUVAR fish_color_cwd:yellow +SETUVAR fish_color_cwd:green SETUVAR fish_color_cwd_root:red SETUVAR fish_color_end:c397d8 SETUVAR fish_color_error:d54e53 diff --git a/fish/functions/dns_flush.fish b/fish/functions/dns_flush.fish new file mode 100644 index 0000000..9d14fbe --- /dev/null +++ b/fish/functions/dns_flush.fish @@ -0,0 +1,8 @@ +function dns_flush + switch (uname -s) + case Darwin + sudo killall -HUP mDNSResponder + case '*' + echo "Unsupported OS: "(uname -s) + end +end diff --git a/install-brew.sh b/install-brew.sh new file mode 100755 index 0000000..460d730 --- /dev/null +++ b/install-brew.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Check if Homebrew is already installed +if [ -x "$(command -v brew)" ]; then + echo "Homebrew is already installed." + exit 0 +fi + +# Install Homebrew by OS +case "$(uname -s)" in + Darwin) + echo "Mac OS" + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ;; + Linux) + echo "Linux" + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" + ;; + *) + echo "Unsupported OS: $(uname -s)" +esac diff --git a/install-symlinks.sh b/install-symlinks.sh index bb82300..c113d3d 100755 --- a/install-symlinks.sh +++ b/install-symlinks.sh @@ -6,7 +6,7 @@ DOTFILES="$HOME/.dotfiles" mkdir -p "$HOME/.config" # Create symlinks, forcing updates -ln -Fsv "$DOTFILES/.bashrc" "$HOME/.bashrc" # bash does not support XDG config -ln -Fsv "$DOTFILES/fish" "$HOME/.config" -ln -Fsv "$DOTFILES/nvim" "$HOME/.config" -ln -Fsv "$DOTFILES/git" "$HOME/.config" +ln -Fsv "$DOTFILES/bash/.bashrc" "$HOME/.bashrc" # Bash does not support XDG config +ln -Fsv "$DOTFILES/fish" "$HOME/.config" +ln -Fsv "$DOTFILES/nvim" "$HOME/.config" +ln -Fsv "$DOTFILES/git" "$HOME/.config"