Setup Mac
=========
This page guides you to set up the new machine to usual state.
# 1. Built-in Software / OS Preferences
## Finder
## System Settings
/ | Guides
---|---
Appearance |
Accessibility |
Control Center |
Desktop & Dock |
Displays |
Touch ID & Password |
Keyboad |
Trackpad |
Mouse |
# 2. Hardware
- Keyboards
- https://happyhackingkb.com/jp/download/
- https://origin.pfultd.com/downloads/hhkb/manual/P3PC-6641-05.pdf
- Mouse
- https://www.logicool.co.jp/ja-jp/setup/ergosetup/mouse-setup/bluetooth.html
# 3. Developments
Let's configure a development environment through a console. At this time, the console app which is pre-installed is only `Terminal.app` by default. So you need to use it to set up these configurations.
## Prerequisites
Install Git.
```bash
xcode-select --install
```
Install Rosetta 2.
```bash
sudo softwareupdate --install-rosetta
```
## Connections for GitHub
Check your keys in `.ssh` folder.
```console
$ ls ~/.ssh
id_rsa id_rsa.pub
```
If you don't have them, create key pairs with the command. (all questions are compulsory but it's OK to leave it blank these)
```bash
cd ~/.ssh && ssh-keygen -t rsa -C "babarot@gmail.com"
```
Copy a public key.
```bash
cat ~/.ssh/id_rsa.pub | pbcopy
```
Next,
1. Go to https://github.com/settings/ssh/new
2. Paste the public key to the text area
3. Confirm to OK or not: `ssh -T git@github.com`
Let's check the connectivity for your GitHub account is working. It goes well if your account name is just displayed.
```console
$ ssh -T git@github.com
Hi babarot! You've successfully authenticated, but GitHub does not provide shell access.
```
## Dotfiles
The first thing you need to do is to clone this repo into a location of your choosing. For example, if you have a `~/Developer` directory where you clone all of your git repos, that's a good choice for this one, too. This repo is setup to not rely on the location of the dotfiles, so you can place it anywhere.
```bash
git clone git@github.com:babarot/dotfiles.git ~/src/github.com/babarot/dotfiles
```
```bash
cd ~/src/github.com/babarot/dotfiles && make install
```
The `make install` will create symbolic links from the dotfiles directory into the `$HOME` directory, allowing for all of the configuration to *act* as if it were there without being there, making it easier to maintain the dotfiles in isolation.
## AFX/Zsh
[afx](https://github.com/babarot/afx/) is a CLI packages (tools, shell plugins, etc) manager. Almost all ZSH configurations are also related to the afx settings, so once you run `afx install` and then relaunch your shell, you can enter the CLI world in the usual state of your shell.
```bash
curl -sL https://raw.githubusercontent.com/babarot/afx/HEAD/hack/install | bash
```
```bash
afx install
```
References:
- My plugins list: [.config/afx](https://github.com/babarot/dotfiles/tree/HEAD/.config/afx)
- Guide & Usage: https://babarot.me/afx
## Homebrew
Almost all apps except for CLI tools (commands/plugins, etc...) are managed by Homebrew (package manager for macOS).
Install `brew` command.
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```
Install apps based on this list: [Brewfile](https://github.com/babarot/dotfiles/tree/HEAD/Brewfile).
```bash
brew bundle
```
References:
- https://brew.sh/
- https://formulae.brew.sh/
> [!TIP]
> Some apps are managed via [mas-cli/mas](https://github.com/mas-cli/mas) (Mac App Store command line interface). Sometimes, the installation by `brew bundle` is failed by various reasons. The most mainly reason for the installation failing is the app is already installed by the organization of Mac owner or the app listed on Mac App Store has been already deleted. In such a case, it is recommended that you install them individually through `mas` command manually as follows.
>
>
>
> (List installed apps via `mas`)
> ```
> mas list
> ```
> (Install an app via `mas`)
> ```bash
> mas install
> ```
## Tmux
[tmux](https://github.com/tmux/tmux) will be installed via Brew. After installed, run `tmux` and press `prefix` + I on tmux to install plugins.
## Go
> [!NOTE]
> This step may become done by `brew` (Brewfile). If so, no longer needed to run this step.
1. Go to https://go.dev/dl/
2. Install via the installer
References:
- https://www.sambaiz.net/article/261/
## Some migrations
### History (Z shell)
```
cat ~/.zsh_history | pbcopy
```
Open https://gist.github.com/ to paste.
Then,
```
pbpaste >| ~/.zsh_history
```
### History (directory changes)
I use [enhancd](https://github.com/babarot/enhancd) to jump a directory. A history of directory changes is `enhancd.log` file.
```
cat ~/.enhancd/enhancd.log | pbcopy
```
Open https://gist.github.com/ to paste.
Then,
```
pbpaste >| ~/.enhancd/enhancd.log
```
# 3. Configure Apps
## 1Password
https://1password.com/
Log in with Setup Code (this is most easier among these methods).
Configure the appearance.
## Google Japanese IME
https://www.google.co.jp/ime/
## iTerm2
https://iterm2.com/
### Install a colorscheme
https://ethanschoonover.com/solarized/
### Configure
Area | Guides
---|---
General |
Appearance |
Profile |
## Obsidian
https://obsidian.md/
Setup Obsidian account and Vault.
Enter encryption password.
Run sync.
Enable [Vimrc Support](https://github.com/esm7/obsidian-vimrc-support) plugin
```
cp /path/to/.obsidian.vimrc ~/Documents/(Obsidian Vault)
```
## Things 3
https://culturedcode.com/things/
Turn on Things Cloud.
## CleanShot X
https://cleanshot.com/
## PopClip
https://www.popclip.app/
Install extensions from https://www.popclip.app/extensions/
- [Base64](https://www.popclip.app/extensions/x/19SiD)
- [Translate Tab](https://www.popclip.app/extensions/x/14UeG)
## Spark
https://sparkmailapp.com/
Log in.
## Spotify
https://open.spotify.com/
Log in.
## Hidden Bar
https://github.com/dwarvesf/hidden
## Magnet
https://magnet.crowdcafe.com/
## MeetingBar
https://meetingbar.app/
## Paste
https://pasteapp.io/
## Yoink
https://eternalstorms.at/yoink/mac/