From 7b9540cd482a40293d2efa85bc9773ef21fab64d Mon Sep 17 00:00:00 2001 From: Noah Masur Date: Sun, 2 Aug 2020 10:20:25 -0400 Subject: [PATCH] clean up scripts --- fish.configlink/fish_variables | 2 ++ fish.configlink/functions/mactools.fish | 3 +++ fish.configlink/functions/notes.fish | 4 ++-- homebrew/Brewfile | 1 + homebrew/Caskfile | 2 ++ scripts/bootstrap | 4 +--- scripts/configure_macos | 24 +++++++++++------------- scripts/install_cargos | 15 --------------- scripts/install_rust | 16 ++++++++++++---- tmux/tmux.conf.symlink | 3 +++ zsh/zshrc.symlink | 2 +- 11 files changed, 38 insertions(+), 38 deletions(-) delete mode 100755 scripts/install_cargos diff --git a/fish.configlink/fish_variables b/fish.configlink/fish_variables index 20097dc..be197c2 100644 --- a/fish.configlink/fish_variables +++ b/fish.configlink/fish_variables @@ -4,8 +4,10 @@ SETUVAR OP_SESSION_enterprise_console:CoIqb03EMshttN\x2dvIfdyWOhc6IIckFS6mBfvRQ9 SETUVAR __fish_initialized:3100 SETUVAR _fish_abbr__01_t:cat SETUVAR _fish_abbr_boot:\x24DOTS/scripts/bootstrap +SETUVAR _fish_abbr_brews:vim\x20\x24DOTS/homebrew/Brewfile SETUVAR _fish_abbr_c:cd SETUVAR _fish_abbr_ca:cargo +SETUVAR _fish_abbr_casks:vim\x20\x24DOTS/homebrew/Caskfile SETUVAR _fish_abbr_cat:bat SETUVAR _fish_abbr_d:deactivate SETUVAR _fish_abbr_db:docker\x20build\x20\x2e\x20\x2dt diff --git a/fish.configlink/functions/mactools.fish b/fish.configlink/functions/mactools.fish index bb2d315..7d8c77b 100644 --- a/fish.configlink/functions/mactools.fish +++ b/fish.configlink/functions/mactools.fish @@ -6,6 +6,9 @@ function mactools cat $argv | pbcopy end + abbr -a brews 'vim $DOTS/homebrew/Brewfile' + abbr -a casks 'vim $DOTS/homebrew/Caskfile' + function brewsearch --description "Install brew plugins" set -l inst (brew search | eval "fzf $FZF_DEFAULT_OPTS -m --header='[brew:install]'") diff --git a/fish.configlink/functions/notes.fish b/fish.configlink/functions/notes.fish index c4fb2bc..1a886a5 100644 --- a/fish.configlink/functions/notes.fish +++ b/fish.configlink/functions/notes.fish @@ -10,7 +10,7 @@ function notes --description "Notes functions" else set yesterday (date -jv "-1d" +"%Y-%m-%d_%a") set tomorrow (date -jv "+1d" +"%Y-%m-%d_%a") - set weather (curl "https://wttr.in/?format=1") + set weather (curl -s "https://wttr.in/?format=1") printf "[[$yesterday|Previous]] - [[calendar|Index]] - [[$tomorrow|Next]]\n\n---\n\n$weather\n\n # Tasks\n\n\n# Log\n\n\n# Communication\n\n---\n\n# Meetings\n\n" > $today_journal echo "New journal added." end @@ -25,7 +25,7 @@ function notes --description "Notes functions" else set yesterday (date -jv "-1d" +"%Y-%m-%d_%a") set tomorrow (date -jv "+1d" +"%Y-%m-%d_%a") - set weather (curl "https://wttr.in/?format=1") + set weather (curl -s "https://wttr.in/?format=1") printf "[[$yesterday|Previous]] - [[calendar|Index]] - [[$tomorrow|Next]]\n\n---\n\n$weather\n\n # Tasks\n\n\n# Log\n\n\n# Communication\n\n---\n\n# Meetings\n\n" > $today_journal echo "New journal added." vim $today_journal diff --git a/homebrew/Brewfile b/homebrew/Brewfile index 9314523..8cac4fc 100644 --- a/homebrew/Brewfile +++ b/homebrew/Brewfile @@ -20,6 +20,7 @@ brew "wget" # Not quite curl brew "telnet" # Check networking brew "prettyping" # Better ping brew "httpie" # Better curl +brew "nushell" # Data manipulation shell brew "shellcheck" # Lint for bash brew "pyenv" # Python installations brew "pyenv-virtualenv" # Python virtualenvs diff --git a/homebrew/Caskfile b/homebrew/Caskfile index de93882..08f7f5f 100644 --- a/homebrew/Caskfile +++ b/homebrew/Caskfile @@ -7,6 +7,7 @@ cask "slack" cask "zoomus" cask "1password" cask "1password-cli" +cask "lastpass" cask "dropbox" # Fonts @@ -21,6 +22,7 @@ cask "scroll-reverser" cask "authy" cask "postman" cask "drawio" +cask "meetingbar" # Personal cask "discord" diff --git a/scripts/bootstrap b/scripts/bootstrap index 04e2c10..45b49a1 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -126,14 +126,11 @@ install_spacemacs() { } printf "\nbootstrapping...\n\n" -#check_for_zsh -#check_for_ohmyzsh install_xcode install_homebrew install_brews setup_tmux install_gitmux -install_spacemacs use_fish_shell ("$DOTS/scripts/setup_symlinks") @@ -144,4 +141,5 @@ echo " - configure_macos" echo " - setup_keybase" echo " - install_python" echo " - install_rust" +echo " - install_cargos" echo "" diff --git a/scripts/configure_macos b/scripts/configure_macos index 64a95d5..abf7d89 100755 --- a/scripts/configure_macos +++ b/scripts/configure_macos @@ -3,18 +3,12 @@ echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)" defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 -echo "Enable subpixel font rendering on non-Apple LCDs" -defaults write NSGlobalDomain AppleFontSmoothing -int 2 - -echo "Do NOT automatically show and hide the dock" -defaults write com.apple.dock autohide -bool false +echo "Automatically show and hide the dock" +defaults write com.apple.dock autohide -bool true echo "Make Dock icons of hidden applications translucent" defaults write com.apple.dock showhidden -bool true -echo "Do NOT show all filename extensions in Finder" -defaults write NSGlobalDomain AppleShowAllExtensions -bool false - echo "Use current directory as default search scope in Finder" defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" @@ -75,9 +69,6 @@ defaults write NSGlobalDomain WebKitDeveloperExtras -bool true # echo "Only use UTF-8 in Terminal.app" # defaults write com.apple.terminal StringEncodings -array 4 -# echo "Make ⌘ + F focus the search input in iTunes" -# defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F" - # Noah Prefs echo "Enable dock magnification" defaults write com.apple.dock magnification -bool true @@ -90,8 +81,15 @@ echo "Turn on Scroll Reverser" open /Applications/Scroll\ Reverser.app osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Scroll Reverser.app", hidden:false}' -# echo "Allow apps from anywhere" -# sudo spctl --master-disable +echo "Allow apps from anywhere" +SPCTL=$(spctl --status) +if ! [ "$SPCTL" = "assessments disabled" ] +then + sudo spctl --master-disable +fi + +# App Store Installs +mas install 1017470484 # NextMeeting - show upcoming meeting in menu bar # --- diff --git a/scripts/install_cargos b/scripts/install_cargos deleted file mode 100755 index 7bc580d..0000000 --- a/scripts/install_cargos +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -install_cargos() { - programs=( - cargo-edit - cargo-whatfeatures - jql - racer - rustlings - toml-cli - ) - for i in "${programs[@]}"; do - cargo install "$i" - done -} diff --git a/scripts/install_rust b/scripts/install_rust index cf0a3ac..3c7ff1e 100755 --- a/scripts/install_rust +++ b/scripts/install_rust @@ -22,18 +22,26 @@ download_rust_analyzer() { then echo "downloading rust analyzer" rust_analyzer_bin=/usr/local/bin/rust-analyzer - curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-mac -o $rust_analyzer_bin + curl -s -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-mac -o $rust_analyzer_bin chmod +x $rust_analyzer_bin fi echo "rust-analyzer ✓" } -cargo_tools() { - cargo install toml-cli - cargo install jql +install_cargos() { + programs=( + cargo-edit + cargo-whatfeatures + jql + toml-cli + ) + for i in "${programs[@]}"; do + cargo install "$i" + done } install_rust update_rust download_rust_analyzer +install_cargos diff --git a/tmux/tmux.conf.symlink b/tmux/tmux.conf.symlink index 26eb92f..5ea47d0 100644 --- a/tmux/tmux.conf.symlink +++ b/tmux/tmux.conf.symlink @@ -1,3 +1,6 @@ +# Colors for CoC +set-option -g default-terminal "screen-256color" + # Keep plenty of history for scrollback set -g history-limit 100000 diff --git a/zsh/zshrc.symlink b/zsh/zshrc.symlink index 5d93cdf..ddddc84 100644 --- a/zsh/zshrc.symlink +++ b/zsh/zshrc.symlink @@ -9,4 +9,4 @@ source $DOTS/zsh/vim [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -source ~/.iterm2_shell_integration.zsh +#source ~/.iterm2_shell_integration.zsh