你已经感受到了使用 Homebrew 安装命令行程序的便利。那么接下来,我们将通过 Homebrew Cask 优雅、简单、快速的安装和管理 OS X 图形界面程序,比如 Google Chrome 和 Dropbox。
安装 Homebrew-cask 是如此的简单直接,运行以下命令即可完成:
$ brew tap phinze/homebrew-cask
$ brew install brew-cask
$ brew cask install google-chrome // 安装 Google 浏览器
$ brew update && brew upgrade brew-cask && brew cleanup // 更新
如果你想查看 cask 上是否存在你需要的 app,可以到 caskroom.io 进行搜索。
有些 插件 可以让 Mac 上的文件预览更有效,比如语法高亮、markdown 渲染、json 预览等等。
List of useful Quick Look plugins for developers
brew cask install <package>
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv betterzipql qlimagesize webpquicklook suspicious-package
qlmanage -r
Preview source code files with syntax highlighting
Run brew cask install qlcolorcode
or download manually
Preview plain text files without a file extension. Example: README, CHANGELOG, etc.
Run brew cask install qlstephen
or download manually
Preview Markdown files
Run brew cask install qlmarkdown
or download manually
Preview JSON files
Run brew cask install quicklook-json
or download manually
Preview .patch files
Run brew cask install qlprettypatch
or download manually
Preview CSV files
Run brew cask install quicklook-csv
or download manually
Preview archives
Run brew cask install betterzipql
or download manually
Display image size and resolution
Run brew cask install qlimagesize
or download manually
Preview WebP images
Run brew cask install webpquicklook
or download manually
Preview the contents of a standard Apple installer package
Run brew cask install suspicious-package
or download manually
These are not included in Install all.
Preview iOS / OS X app and provision information
Run brew cask install provisionql
or download manually
Run this in your terminal to allow text selection in the Quick Look window:
defaults write com.apple.finder QLEnableTextSelection -bool true && killall Finder
$ brew cask install alfred
$ brew cask install appcleaner
$ brew cask install cheatsheet
$ brew cask install dropbox
$ brew cask install google-chrome
$ brew cask install onepassword
$ brew cask install sublime-text
$ brew cask install totalfinder
...
译注:
译者本人并不喜欢 brew cask 的安装方式,更倾向于到 App Store 或官方下载 OS X 图形界面程序。主要因为名字不好记忆、偶尔需要手动更新,另外当你使用 Alfred 或 Spotlight ,你将发现将程序安装在 ~/Application 会很方便。
Alfred 是个很不错的东西,推荐必须安装。它默认搜索目录不包含brew cask安装的软件,因此手动将
/opt/homebrew-cask
添加到Alfred的搜索目录
安装完 homebrew 默认是没有这个命令的,通过 brew services 可以方便地管理通过 homebrew 安装的服务进程,比如 nginx, mysql 等
brew tap homebrew/services
$ brew install mysql
$ brew services start mysql
Stop service mysql:
$ brew services stop mysql
Restart service mysql:
$ brew services restart mysql
$ brew install dnsmasq
$ sudo brew services start dnsmasq
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>
# [<sudo>] `brew services` `stop` <formula><br>
# [<sudo>] `brew services` `cleanup`<br>
brew tap jimbojsb/launchrocket
brew cask install launchrocket