From 1b2305eaa603883db9117541f7292937b19e6efe Mon Sep 17 00:00:00 2001 From: Tristan Smith Date: Thu, 11 Nov 2021 03:04:55 -0500 Subject: [PATCH] Update commenting, theme, packages --- Brewfile | 10 ++++ Makefile | 129 +++++++++++++++++++++++++++++-------------------- zsh/.zsh_theme | 9 ++-- zsh/.zshrc | 5 ++ 4 files changed, 97 insertions(+), 56 deletions(-) diff --git a/Brewfile b/Brewfile index dd29aaf..bce5c44 100644 --- a/Brewfile +++ b/Brewfile @@ -10,11 +10,18 @@ tap "homebrew/cask-versions" # GNU coreutils instead of outdated mac os defaults brew "coreutils" brew "moreutils" +# newer version of bash +brew "bash" +brew "bash-completion" +# newer version of zsh +brew "zsh" +brew "zsh-completions" brew "bradp/vv/vv" || true brew "curl" || true brew "diff-so-fancy" || true brew "direnv" || true +brew "dockutil" || true brew "duti" brew "git" || true brew "gnupg" || true @@ -22,6 +29,7 @@ brew "htop" || true brew "httpie" || true brew "irssi" || true brew "m-cli" || true +brew "mas" || true brew "nmap" || true brew "openssl" || true brew "pinentry-mac" || true @@ -41,6 +49,7 @@ brew "z" || true ##### casks ##### cask "adium" || true cask "alfred" || true +cask "brave-browser" || true cask "cheatsheet" || true cask "cyberduck" || true cask "dash" || true @@ -65,6 +74,7 @@ cask "ngrok" || true cask "numi" || true cask "plex-media-player" || true cask "postman" || true +cask "qlvideo" || true cask "sequel-pro" || true cask "slack" || true cask "spotify" || true diff --git a/Makefile b/Makefile index 2779b02..39fe452 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ -DOTFILES_DIR := ${HOME}/.dotfiles +DOTFILES_DIR := $(HOME)/.dotfiles UNAME := $(shell uname -s) +BREW_CHECK := type brew >/dev/null 2>/dev/null || $(MAKE) brew ifeq ($(UNAME), Darwin) OS := macos @@ -8,7 +9,6 @@ else ifeq ($(UNAME), Linux) endif .PHONY: \ - all \ bash \ brew \ defaults \ @@ -21,26 +21,31 @@ endif vsc \ zsh -all: install - -install: $(OS) - -linux: \ - # TBD - -macos: \ - brew \ - bash \ - zsh \ - node \ - vsc \ - stow \ - defaults \ - ~/.ssh/config - -brew: \ - /usr/local/bin/brew - # upgrade and clean all installed packages +install: $(OS) ## Default install all by OS. + +help: + @echo 'Usage:' + @echo ' make ' + @echo + @echo 'Targets:' + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[0m%-10s\033[0m %s\n", $$1, $$2}' + +linux: ## TBD (Manually install everything for Linux.) + +macos: ## Manually install everything for MacOS. + @echo 'Installing for MacOS...' + $(MAKE) brew + $(MAKE) bash + $(MAKE) zsh + $(MAKE) node + $(MAKE) vsc + $(MAKE) stow + $(MAKE) defaults + [ -d $(HOME)/.ssh/config ] || mkdir -p $(HOME)/.ssh/config + softwareupdate -d -a + +brew: /usr/local/bin/brew ## Install brew and all applications. + @echo 'Updating all brew packages...' brew update --verbose brew upgrade --verbose brew cleanup -s @@ -50,29 +55,25 @@ brew: \ curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash brew analytics off -bash: brew - # newer version of bash - brew install bash - brew install bash-completion - +bash: ## Install an updated Bash shell. + $(BREW_CHECK) + @echo 'Updating bash...' stow bash --restow # change shell to homebrew bash echo "/usr/local/bin/bash" | sudo tee -a /etc/shells chsh -s /usr/local/bin/bash -zsh: brew - # newer version of zsh - brew install zsh - brew install zsh-completions - +zsh: ## Install an updated Zsh shell and theming. + $(BREW_CHECK) + @echo 'Updating zsh / refreshing themes...' @rm -rf ~/.oh-my-zsh sh -c "$$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" /dev/null 2>&1; done -default-Apps: brew +default-Apps: + $(BREW_CHECK) # default IINA (media files) @while read -r ext; do \ duti -s com.colliderli.iina "$ext" all; \ done <"${DOTFILES_DIR}/.duti/iina.txt" defaults-Dock: + $(BREW_CHECK) # Automatically hide and show the Dock defaults write com.apple.dock autohide -bool true # Make Dock icons of hidden applications translucent @@ -217,11 +225,28 @@ defaults-Dock: # Bottom left screen corner → Start screen saver defaults write com.apple.dock wvous-bl-corner -int 5 defaults write com.apple.dock wvous-bl-modifier -int 0 - # clean up right side (persistent) - -defaults delete com.apple.dock persistent-others - # and add these folders - defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":1, "file-label":"Applications", "file-data":{"_CFURLString":"file:///Applications/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; - defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":1, "file-label":"Downloads", "file-data":{"_CFURLString":"file:///Users/tristan/Downloads/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; + # Don't show recent applications in the Dock + defaults write com.apple.dock show-recents -bool false + defaults write com.apple.dock recent-apps -array + + dockutil --no-restart --remove all + + dockutil --no-restart --add "/Applications/Safari.app" + dockutil --no-restart --add "/Applications/Google Chrome.app" + dockutil --no-restart --add "/Applications/Brave Browser.app" + dockutil --no-restart --add "/Applications/Firefox Developer Edition.app.app" + dockutil --no-restart --add "/Applications/Evernote.app" + dockutil --no-restart --add "/Applications/Notes.app" + dockutil --no-restart --add "/Applications/Messages.app" + dockutil --no-restart --add "/Applications/Facetime.app" + dockutil --no-restart --add "/Applications/VirtualBox.app" + dockutil --no-restart --add "/Applications/Visual Studio Code.app" + dockutil --no-restart --add "/Applications/Kitty.app" + dockutil --no-restart --add "/Applications/ExpressVPN.app" + dockutil --no-restart --add "/Applications/System Preferences.app" + + dockutil --no-restart --add "/Applications" --section others --sort name --view grid + dockutil --no-restart --add "$(HOME)/Downloads" --section others --view list defaults-Finder: # Automatically open a new Finder window when a volume is mounted diff --git a/zsh/.zsh_theme b/zsh/.zsh_theme index 9fa662f..74ca6cf 100644 --- a/zsh/.zsh_theme +++ b/zsh/.zsh_theme @@ -2,7 +2,7 @@ export ZSH=~/.oh-my-zsh POWERLEVEL9K_MODE='awesome-fontconfig' -ZSH_THEME="powerlevel9k/powerlevel9k" +ZSH_THEME="powerlevel10k/powerlevel10k" source $ZSH/oh-my-zsh.sh @@ -47,11 +47,12 @@ POWERLEVEL9K_STATUS_VERBOSE=true POWERLEVEL9K_STATUS_CROSS=true POWERLEVEL9K_PROMPT_ADD_NEWLINE=true -POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="╭" -POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="╰\uF460\uF460\uF460 " +POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="╭─" +POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX="├─" +POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="╰─\uF460\uF460\uF460" POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon root_indicator context dir_writable dir vcs) -POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(command_execution_time background_jobs status time ssh) +POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(command_execution_time background_jobs status nvm time ssh) POWERLEVEL9K_VCS_CLEAN_BACKGROUND="$COLOR_GREEN" POWERLEVEL9K_VCS_CLEAN_FOREGROUND="$DEFAULT_BACKGROUND" diff --git a/zsh/.zshrc b/zsh/.zshrc index 4d4c508..5b32932 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,3 +1,8 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + # set paths export PATH="$PATH:$HOME/bin:/usr/local/git/bin:/usr/local/bin:/usr/local/:/usr/local/sbin"