4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

High Sierraでやったこと

Posted at

新しくMacBook12インチを購入したので、その際に自動的についてきたHigh Sierraでやったことを備忘録として。
前の記事からあまり変更はないけれど。

前提として

  • 開発などは別途VPSを借りていて、その上で行なっているので、開発ツールは必要最低限しか入れない。
  • iPad Proにblink.shを入れてそちらでも開発できるようにしてある。

Xcode

xcode-select --install

homebrew

$ cd $HOME && mkdir .homebrew && \
curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C .homebrew

以下は能動的に入れたもの一覧

dfc
dnscrypt-proxy
dnsmasq
ghq
gnu-tar
go
htop
mas
mosh
peco
rbenv
ruby-build
terminal-notifier
tig
tmux
vimpager

更新チェック用に以下のスクリプトを定期的に走らせている

# !/bin/bash

export PATH=$HOME/.homebrew/bin:$HOME/bin:$PATH
BREW_EXEC="$HOME/.homebrew/bin/brew"
TERMINAL_NOTIFIER="$(which terminal-notifier)"
NOTIF_ARGS="-activate com.googlecode.iterm2 -timeout 10"

$BREW_EXEC update > /dev/null 2>&1
outdated="$($BREW_EXEC outdated | tr ' ' '\n')"

if [ ! -z "$outdated" ] ; then
  if [ -e $TERMINAL_NOTIFIER ]; then
    lc=$((`echo "$outdated" | wc -l`))
    outdated=`echo "$outdated" | tail -$lc`
    message=`echo "$outdated" | head -5`
    if [ "$outdated" != "$message" ]; then
      message="Some of the outdated formula are:
$message"
    else
      message="The following formula are outdated:
$message"
    fi
    # Send to the Nofication Center
    $TERMINAL_NOTIFIER $NOTIF_ARGS \
      -title "Homebrew Update(s) Available" -message "$message" > /dev/null 2>&1
  fi
fi

hammerspoon

特定のアプリにスイッチした場合にキーボードレイアウトを変更するスクリプトを設定。下に提示するサンプルではiTerm2の場合にはUSキーボードを、SlackとChatworkの場合にはことえりをオンにするようにしたもの。
ことえりではなくGoogle日本語入力を指定したい場合にはcom.google.inputmethod.Japanese.baseを設定。

local function handleGlobalAppEvent(name, event, app)
  if event == hs.application.watcher.activated then
    if name == "iTerm2" then
      hs.timer.usleep(1500)
      hs.keycodes.currentSourceID("com.apple.keylayout.US")
    elseif name == "ChatWork" then
      hs.timer.usleep(1500)
      hs.keycodes.currentSourceID("com.apple.inputmethod.Kotoeri.Japanese")
    elseif name == "Slack" then
      hs.timer.usleep(1500)
      hs.keycodes.currentSourceID("com.apple.inputmethod.Kotoeri.Japanese")
    end
  end
end

appsWatcher = hs.application.watcher.new(handleGlobalAppEvent)
appsWatcher:start()

defaults

テキストエディットのデフォルトをプレインテキストに

defaults write com.apple.TextEdit RichText -int 0

Dockに最近使ったアプリを追加

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' && \
killall Dock

写真アプリの自動起動を抑止

defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES

ネットワークドライブに .DS_Store を作らない

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

USBドライブに .DS_Store を作らない

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

1password 購読版に変更。

今まで別アカウントで購入していたが、この機会に月額のサブスクリプションに移行した。
移行に伴い下記のことができるようになる。

  • Web上のクラウドサービスが利用可能に
  • CLIでつかえるように

アンチウイルスソフト

ClamAV から bitdefender へ移行した。

入れたアプリ

MacAppStore経由

Spark.app
Kaleidoscope.app
1Password.app
Numbers.app
iMovie.app
Yummy FTP.app
Keynote.app
Quiver.app
Pages.app
The Unarchiver.app
CotEditor.app
Trello.app
Slack.app
Twitter.app

外部

Bitdefender
hammerspoon
karabiner-elements
numi
iterm2
alfred
macvim-kaoriya

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?