Last active
July 14, 2020 14:31
-
-
Save ay65535/d54563f48563fc2d4c404d44cc210725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find ~ -type f -name '.localized' -maxdepth 2 -delete | |
# see http://neos21.hatenablog.com/entry/2019/01/10/080000 | |
chflags nohidden ~/Library # ~/Library ディレクトリを見えるようにする | |
# 全ての拡張子のファイルを表示する | |
defaults write NSGlobalDomain AppleShowAllExtensions -bool true | |
# キーリピートの速度 | |
defaults write NSGlobalDomain KeyRepeat -int 2 | |
# キーリピート開始までのタイミング | |
defaults write NSGlobalDomain InitialKeyRepeat -int 15 | |
# 検索時にデフォルトでカレントディレクトリを検索する | |
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" | |
# 拡張子変更時の警告を無効化する | |
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false | |
# クイックルックでテキストを選択可能にする | |
defaults write com.apple.finder QLEnableTextSelection -bool true | |
# パスバーを表示する | |
defaults write com.apple.finder ShowPathbar -bool true | |
# ステータスバーを表示する | |
#defaults write com.apple.finder ShowStatusBar -bool true | |
# タブバーを表示する | |
#defaults write com.apple.finder ShowTabView -bool true | |
# ファイルのダウンロード後に自動でファイルを開くのを無効化する | |
#defaults write com.apple.Safari AutoOpenSafeDownloads -bool false | |
# Safari の開発・デバッグメニューを有効にする | |
defaults write com.apple.Safari IncludeDevelopMenu -bool true | |
# Safari の開発・デバッグメニューを有効にする | |
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true | |
# アドレスバーに完全な URL を表示する | |
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true | |
# ステータスバーを表示する | |
#defaults write com.apple.Safari ShowStatusBar -bool true | |
#defaults write com.apple.Safari SuppressSearchSuggestions -bool true # 検索クエリを Apple へ送信しない | |
#defaults write com.apple.Safari UniversalSearchEnabled -bool false # 検索クエリを Apple へ送信しない | |
#defaults write com.apple.screencapture disable-shadow -bool true # スクリーンキャプチャの影をなくす | |
#defaults write com.apple.screencapture type -string "png" # スクリーンショットの保存形式を PNG にする | |
defaults write "com.agilebits.onepassword7" "OPPrefMasterPasswordTimeoutInMinutesKey" -int 20160 | |
defaults write "com.agilebits.onepassword7" "ShowItemCounts" -bool True | |
defaults write "com.agilebits.onepassword7" "ShowStatusItem" -bool True | |
defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadThreeFingerDrag" -bool True | |
defaults write "com.apple.AppleMultitouchTrackpad" "Clicking" -bool True | |
defaults write "com.apple.AppleMultitouchTrackpad" "TrackpadFourFingerVertSwipeGesture" -int 2 | |
defaults write "com.apple.Safari" "AlwaysRestoreSessionAtLaunch" -bool True | |
#defaults write "com.apple.Safari" "HomePage" -string "https://www.apple.com/jp/startpage/" | |
defaults write "com.apple.dock" "orientation" -string "left" | |
defaults write "com.apple.dock" "minimize-to-application" -bool True | |
defaults write "com.apple.dock" "tilesize" -int 32 | |
defaults write "com.apple.finder" "ShowHardDrivesOnDesktop" -bool True | |
defaults write "com.apple.finder" "ShowRemovableMediaOnDesktop" -bool True | |
defaults write "com.apple.finder" "ShowExternalHardDrivesOnDesktop" -bool True | |
defaults write "com.apple.inputmethod.Kotoeri" "JIMPrefWindowsModeKey" -bool True | |
defaults write "com.apple.inputmethod.Kotoeri" "JIMPrefCharacterForYenKey" -int 1 | |
defaults write "com.clipy-app.Clipy" "kCPYPrefNumberOfItemsPlaceInlineKey" -int 20 | |
defaults write "com.clipy-app.Clipy" "kCPYPrefMaxMenuItemTitleLengthKey" -int 200 | |
defaults write "com.clipy-app.Clipy" "kCPYPrefNumberOfItemsPlaceInsideFolderKey" -int 20 | |
sudo cp -p /etc/pam.d/sudo{,.orig} | |
sudo vim /etc/pam.d/sudo | |
# Download Xcode Beta | |
echo https://developer.apple.com/download/ | |
xcode-select -p | |
gcc -v | |
xcode-select --install | |
gcc -v | |
# Generate GitHub ssh key | |
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
eval "$(ssh-agent -s)" | |
vim ~/.ssh/config | |
ssh-add -K ~/.ssh/id_rsa | |
ssh-add -l | |
pbcopy < ~/.ssh/id_rsa.pub | |
# Install Homebrew | |
echo https://brew.sh/index_ja | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew doctor | |
# Install Homebrew-file | |
brew tap rcmdnk/file | |
brew install brew-file --HEAD | |
source $(brew --prefix)/etc/brew-wrap | |
brew file set_repo | |
# Tap repositories and their packages | |
brew tap homebrew/core | |
# brew tap homebrew/dupes # Error: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated. | |
brew tap homebrew/cask | |
brew tap homebrew/cask-versions | |
# Install essential casks | |
brew cask install iterm2-nightly | |
#brew cask install iterm2-legacy | |
brew cask install 1password | |
#brew cask install 1password6 | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture x64 --verbose --channel 2.1 --install-dir ~/.local/share/dotnet --dry-run | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture x64 --verbose --channel 2.1 --install-dir ~/.local/share/dotnet | |
brew cask install visual-studio-code-insiders | |
brew cask install github-beta | |
# https://github.com/whomwah/qlstephen#permissions-quarantine | |
brew search qlstephen | |
brew cask info qlstephen | |
brew cask install qlstephen | |
xattr -cr ~/Library/QuickLook/QLStephen.qlgenerator | |
qlmanage -r | |
qlmanage -r cache | |
# Install dotfiles deps | |
brew install tree | |
brew install diff-so-fancy --HEAD | |
#brew install pcre2 --HEAD # build error | |
pushd /Users/ats/Library/Caches/Homebrew \ | |
&& rm -rf pcre2--svn-HEAD \ | |
&& brew fetch pcre2 --HEAD \ | |
&& cd pcre2--svn-HEAD \ | |
&& autoreconf --install --force \ | |
&& ./configure --prefix=/usr/local/Cellar/pcre2/HEAD-1175 --enable-pcre2-16 --enable-pcre2-32 --enable-pcre2grep-libz --enable-pcre2grep-libbz2 --enable-jit \ | |
&& make \ | |
&& make install \ | |
&& brew link pcre2 \ | |
&& popd | |
brew install git --HEAD | |
brew install python@2 --HEAD | |
brew install mercurial | |
brew install libiconv | |
brew install rsync | |
brew install node --HEAD | |
brew install go --HEAD | |
brew install fzf --HEAD | |
brew install coreutils #--HEAD # build error | |
brew install grep | |
# Setup dotfiles | |
cd $HOME | |
git clone --recursive https://github.com/ay65535/dotfiles.git .dotfiles | |
link_with_backup () { | |
local target="$1" | |
local dotdir="${2:-.dotfiles}" | |
if [ -e "${dotdir}/$target" ]; then | |
# link .dotfiles/.target -> ~/.target | |
gln -s --no-dereference --force --verbose --backup=existing "${dotdir}/${target}" "$target" | |
elif [ -e "${dotdir}/${target#.}" ]; then | |
# link .dotfiles/target -> ~/.target | |
gln -s --no-dereference --force --verbose --backup=existing "${dotdir}/${target#.}" "$target" | |
else | |
echo "${dotdir}/${target} does not exist." >&2 | |
fi | |
} | |
link_with_backup bin | |
link_with_backup .config | |
link_with_backup .bash_profile | |
link_with_backup .bashrc | |
link_with_backup .curlrc | |
link_with_backup local | |
link_with_backup .profile | |
link_with_backup .tmux.conf | |
link_with_backup .zshenv | |
ls -laFGh | |
ls -laFGhL | |
brew install pcre --HEAD | |
brew install zsh --HEAD | |
brew install zsh-completions --HEAD | |
zinit | |
zinit self-update | |
zinit zstatus | |
zinit ls | |
zinit update | |
zinit status | |
zinit report | |
zinit uncompile | |
zinit compile | |
zinit compinit | |
git config --global include.path '~/.config/git/config.core' | |
# Restore data | |
tmrestore.sh "/Volumes/TimeMachine/Backups.backupdb/macbook/Latest/Macintosh HD - Data/Users/$USER" | |
brew cask install fork | |
brew cask install clipy | |
brew cask install disk-inventory-x | |
brew cask install firefox-developer-edition | |
brew cask install microsoft-remote-desktop-beta | |
brew cask install google-japanese-ime-dev | |
brew cask install docker-edge | |
brew cask install powershell-preview | |
echo https://developer.apple.com/fonts/ | |
brew tap homebrew/cask-fonts | |
brew cask install font-fira-code | |
brew cask install font-cascadia | |
brew tap sanemat/font | |
brew install ricty --with-powerline | |
brew install rcmdnk/rcmdnkpac/parse-plist --HEAD | |
brew install bash-completion | |
brew install brew-cask-completion | |
brew install gnu-sed | |
brew install watch --HEAD | |
brew install pstree | |
brew install git-lfs | |
brew install git-flow-avh | |
brew install gibo | |
brew install ghq | |
brew install lesspipe --with-syntax-highlighting | |
brew install shfmt | |
brew install swiftformat | |
brew install afsctool | |
brew install youtube-dl | |
brew tap beeftornado/rmtree | |
brew install brew-rmtree | |
brew install ruby-build --HEAD | |
brew install rbenv --HEAD | |
brew install libssh2 --HEAD | |
brew install rust --HEAD | |
brew install oniguruma --HEAD | |
brew install pipenv | |
brew install jq --HEAD | |
brew install ghc #--HEAD # build error | |
brew install cabal-install #--HEAD # build error | |
brew install pandoc --HEAD | |
## Nord | |
mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes | |
curl https://raw.githubusercontent.com/arcticicestudio/nord-xcode/develop/src/Nord.xccolortheme -o ~/Library/Developer/Xcode/UserData/FontAndColorThemes/Nord.xccolortheme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment