From cfed6832ad182a2497914d7b355712aa69f9f538 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sun, 27 Sep 2020 19:58:44 +0100 Subject: [PATCH] Update dotfiles --- .config/starship.toml | 2 +- .dotfiles/aliases | 9 +++------ .dotfiles/environment | 8 +++++--- .zshrc | 24 ------------------------ Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 34 deletions(-) create mode 100644 Makefile diff --git a/.config/starship.toml b/.config/starship.toml index 7403e14..b64837e 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,7 +1,7 @@ prompt_order=["directory","git_branch","git_commit","git_state","git_status","package","golang","nodejs","terraform","memory_usage","aws","kubernetes","cmd_duration","custom","line_break","jobs","battery","time","character"] [character] -symbol = "⚡️ " +symbol = "✨ " error_symbol = "✗ " use_symbol_for_status = true style_success = "yellow" diff --git a/.dotfiles/aliases b/.dotfiles/aliases index 6685966..68b9953 100644 --- a/.dotfiles/aliases +++ b/.dotfiles/aliases @@ -4,18 +4,15 @@ alias watch='watch ' alias cat=' bat ' alias curl='curlie' alias tmp='cd $(mktemp -d)' -alias ls=' exa --group-directories-first --header --git' +alias ls=' exa --group-directories-first --icons --header --git --ignore-glob=.git' lt() { DEPTH=$(echo $1 | grep "^[0-9]*$") - - if [ "$DEPTH" = "" ] - then + if [ "$DEPTH" = "" ]; then DEPTH=2 else shift fi - - ls --tree -L $DEPTH -I "cache|log|logs|node_modules|vendor" $@ + ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@ } alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION amazon/aws-cli' diff --git a/.dotfiles/environment b/.dotfiles/environment index 618ddde..fc7e3a7 100644 --- a/.dotfiles/environment +++ b/.dotfiles/environment @@ -3,9 +3,11 @@ export EDITOR='vim' export VISUAL='code' # AWS -export AWS_PROFILE=$(cat ~/.aws/profile) -export AWS_DEFAULT_REGION=eu-west-1 -export AWS_REGION=eu-west-1 +if [ -f ~/.aws/profile ]; then + export AWS_PROFILE=$(cat ~/.aws/profile) + export AWS_DEFAULT_REGION=eu-west-1 + export AWS_REGION=eu-west-1 +fi # Node export NODE_ENV=localhost diff --git a/.zshrc b/.zshrc index a803a90..656ba8f 100644 --- a/.zshrc +++ b/.zshrc @@ -1,27 +1,3 @@ -# pre-reqs -if [ ! -f ~/.shell-prereqs-installed ]; -then - echo "Installing prereqs" - which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - [ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - which fzf > /dev/null || brew install fzf - which bat > /dev/null || brew install bat - which curlie > /dev/null | brew install rs/tap/curlie - which exa > /dev/null || brew install exa - which kubectl > /dev/null || brew install kubectl - which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli - which k9s > /dev/null || brew install k9s - which helm > /dev/null || brew install helm - which go > /dev/null || brew install go - which jq > /dev/null || brew install jq - which kind > /dev/null || brew install kind - which kubectx > /dev/null || brew install kubectx - brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font - which starship > /dev/null || brew install starship - - touch ~/.shell-prereqs-installed -fi - for filename in ~/.dotfiles/*; do source $filename done diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ad33563 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +SHELL := bash + +.PHONY: Install +install: pre-reqs dotfiles ## Installs all dotfiles and associated. + +.PHONY: pre-reqs +pre-reqs: ## Install all required binaries. + which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; \ + [ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \ + brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ + which fzf > /dev/null || brew install fzf; \ + which bat > /dev/null || brew install bat; \ + which curlie > /dev/null | brew install rs/tap/curlie; \ + which exa > /dev/null || brew install exa; \ + which kubectl > /dev/null || brew install kubectl; \ + which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli; \ + which k9s > /dev/null || brew install k9s; \ + which helm > /dev/null || brew install helm; \ + which go > /dev/null || brew install go; \ + which jq > /dev/null || brew install jq; \ + which kind > /dev/null || brew install kind; \ + which kubectx > /dev/null || brew install kubectx; \ + which tldr > /dev/null || brew install tldr; \ + which progress > /dev/null || brew install progress; \ + which htop > /dev/null || brew install htop; \ + which starship > /dev/null || brew install starship + +.PHONY: dotfiles +dotfiles: ## Installs the dotfiles. + for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \ + f=$$(basename $$file); \ + ln -sfn $$file $(HOME)/$$f; \ + done; \ + mkdir -p $(HOME)/.config + for file in $(shell find $(CURDIR)/.config -type f); do \ + f=$$(basename $$file); \ + ln -sfn $$file $(HOME)/.config/$$f; \ + done; + +.PHONY: help +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'