Skip to content

Commit

Permalink
new m1 install cleanup, improvements
Browse files Browse the repository at this point in the history
tmp todo notes
explain where that file came from
justified
move standup
ensure that prepending always happens, add tips to rake completion
remove old machine
fix flags on subl as EDITOR
  • Loading branch information
nonrational committed May 30, 2024
1 parent 91bca96 commit a579590
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .bash_completion.d/rake.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# Fixing it to restrict changes to rakecomplete only.
# export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}

# Troubleshooting ===
# If completion isn't working, ensure you've bundled and that bare `rake` works.
# After that, you may need to `rm .rake_tasks~`.

_rakecomplete() {
local cur
_get_comp_words_by_ref -n : cur
Expand Down
19 changes: 8 additions & 11 deletions .bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@

BASH_REPORT_MISSING_SOURCES=true

# Copied from https://github.com/scop/bash-completion/bash_completion
# Fixes https://github.com/Backblaze/B2_Command_Line_Tool/issues/500
_have()
{
# Completions for system administrator commands are installed as well in
# case completion is attempted via `sudo command ...'.
PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null
}

prepend_new_path_if_exists() {
[ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]] && export PATH="$1:$PATH"
if [ -d "$1" ]; then
# Pop the path off PATH (with pipes) before prepending it to PATH. ;)
# This is preferable to no-op'ing if the path already exists, to ensure that system paths
# don't take precedence in tmux or screen-like environments.
local CLEAN_PATH=$(echo "${PATH}:" | sed -e "s|$1:||" -e 's|:$||')
export PATH="$1:$CLEAN_PATH"
fi
}

# don't bother adding paths if it'll do no good.
Expand All @@ -39,7 +36,7 @@ if command -v brew &> /dev/null; then
source_if_exists "${HOMEBREW_ROOT}/etc/profile.d/bash_completion.sh"
fi

source_if_exists "$HOME/.fzf.bash"
source_if_exists "$HOME/.fzf.bash" # fzf --bash > ~/.fzf.bash
source_if_exists "$HOME/.bashrc"

# always prefer the current directory's bin
Expand Down
2 changes: 1 addition & 1 deletion .bashrc.Darwin
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export BASH_SILENCE_DEPRECATION_WARNING=1

export EDITNOW='subl'
export EDITOR='subl -w'
export EDITOR='subl -w -n'
export LESS="$LESS -i -F -R -X"

export CLICOLOR=1
Expand Down
1 change: 1 addition & 0 deletions .bashrc.Linux
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ source_if_exists() {
[[ -s "$1" ]] && source "$1"
}

source_if_exists "$HOME/.fzf.bash"
source_if_exists "$HOME/.homesick/repos/homeshick/homeshick.sh"
source_if_exists "$HOME/.homesick/repos/homeshick/completions/homeshick-completion.bash"
source_if_exists "$HOME/.asdf/asdf.sh"
Expand Down
9 changes: 9 additions & 0 deletions .bashrc.mercury
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/usr/bin/env bash

# Copied from https://github.com/scop/bash-completion/bash_completion
# Fixes https://github.com/Backblaze/B2_Command_Line_Tool/issues/500
_have()
{
# Completions for system administrator commands are installed as well in
# case completion is attempted via `sudo command ...'.
PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null
}

# enable the 1password ssh agent
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock

Expand Down
3 changes: 1 addition & 2 deletions .bashrc.eris → .bashrc.perses
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export ERL_AFLAGS="-kernel shell_history enabled"
export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"
export PATH="$HOME/.parallelize/bin:$PATH"


alias standup="subl ~/Documents/standup.md"
alias standup="subl ~/.parallelize/standup.md"
alias fmcode="code ~/wrk/futurism.code-workspace"
alias fmstart="tmuxinator start futurism"
alias fmstop="tmuxinator stop futurism"
Expand Down
4 changes: 1 addition & 3 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ tap "homebrew/services"

tap "1password/tap"

# tap 'puma/puma'
# brew 'puma/puma/puma-dev'

# __ _
# / _| ___ _ __ _ __ ___ _ _| | __ _
# | |_ / _ \| '__| '_ ` _ \| | | | |/ _` |
Expand All @@ -29,6 +26,7 @@ brew "gnu-sed"
brew "gnu-tar"
brew "gnupg"
brew "hub"
brew "just"
brew "mas"
brew "openssl"
brew "rclone"
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
SHELL := /bin/bash

default:
@echo "Cowardly refusing to run on $(shell uname). Use platform specific targets."

brew-install:
/bin/bash -c "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew-bundle:
eval "$$(/opt/homebrew/bin/brew shellenv)"
brew update
brew bundle
/opt/homebrew/bin/brew shellenv > /tmp/brew-shell.env
source /tmp/brew-shell.env && which brew && brew update && brew bundle

macos:
sh .macos
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ cd .dotfiles
make brew-install
make brew-bundle

# close terminal
# grant iterm full disk access
# auth with 1password
# safari auth to github

# set modern bash as the default shell
(($(grep bash /etc/shells | wc -l)<2)) && which -a bash | head -n1 | sudo tee -a /etc/shells
chsh -s $(which -a bash | head -n1)

if [ -f /opt/homebrew/bin/bash ]; then
echo '/opt/homebrew/bin/bash' | sudo tee -a /etc/shells
chsh -s '/opt/homebrew/bin/bash'
else
echo 'Unable to set default shell to `/opt/homebrew/bin/bash`'
fi

make link-dotfiles
make link-karabiner
Expand All @@ -27,6 +37,9 @@ make restore-preferences
make macos-reset-dock
make macos-disable-restore-apps-on-login
make macos
# restart

# enable 1password shell integration / ssh agent
```

## GNU/Linux
Expand Down
8 changes: 8 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# TODO

## macOS Config

- Disable Click wallpaper to reveal desktop
- Correctly configure 4-finger swiping
- Grant iTerm.app full disk access
- Grant 1Password, Karabiner, and Dropbox accessibility access

0 comments on commit a579590

Please sign in to comment.