- 投稿日:2020-10-24T13:02:01+09:00
秋の dotfiles 大掃除【Alacritty編】
AlacrittyはRust製のターミナルエミュレータで、GPUを利用することで高速なレンダリングを実現しています。macOS、Linux、Windows、BSDなどの主要なOSで使用できます。
環境
- macOS Catalina 19.15.7
- Rust 1.47.0(stable)
インストール
macOSにAlacrittyをインストールする方法は3つあります。
- ソースコードからビルドする
Homebrew
でインストールcargo
でインストール
Homebrew
やcargo
でインストールする場合、 terminfo fileやdesktop entry、manual page、 シェル補完を利用できなくなりますが、Rustの環境を構築する必要がなく(cargoを利用する場合は必要)、簡単にAlacrittyをインストールできます。
詳しくはマニュアルインストールを確認してください。ソースコードからビルド
1. Rustの環境を構築する
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh2. リポジトリからソースコードをクローンする
git clone https://github.com/alacritty/alacritty.git cd alacritty
3. AlacrittyをコンパイルするRustのバージョンを指定する
rustup override set stable rustup update stable
4. Alacrittyのビルドとインストール
make app cp -r target/release/osx/Alacritty.app /Applications/Homebrewでインストール
HomebrewでAlacrittyをインストールする
brew cask install alacritty
cargoでインストール
1. Rustの環境を構築する
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh2. cargoでAlacrittyをインストールする
cargo install alacritty
設定
設定ファイルの優先順位
$XDG_CONFIG_HOME/alacritty/alacritty.yml
$XDG_CONFIG_HOME/alacritty.yml
$HOME/.config/alacritty/alacritty.yml
$HOME/.alacritty.yml
Alacrityは上記の順番で設定ファイルが読み込まれます。
macOSの場合、デフォルトでは$XDG_CONFIG_HOME
は設定されていないので$HOME/.config/alacritty/alacritty.yml
と$HOME/.alacritty.yml
が読み込まれるでしょう。
今回は$HOME/.config/alacritty/alacritty.yml
に設定を記述します。設定ファイル
$HOME/.config/alacritty/alacritty.ymlshell: program: /usr/local/bin/fish args: - --login - --command - "tmux attach || tmux" # テーマ colors: primary: background: '#32302f' foreground: '#ebdbb2' normal: black: '#282828' red: '#cc241d' green: '#98971a' yellow: '#d79921' blue: '#458588' magenta: '#b16286' cyan: '#689d6a' white: '#a89984' bright: black: '#928374' red: '#fb4934' green: '#b8bb26' yellow: '#fabd2f' blue: '#83a598' magenta: '#d3869b' cyan: '#8ec07c' white: '#ebdbb2' # フォント font: size: 12 # フォントサイズ normal: family: 'Source Code Pro' style: Regular bold: family: 'Source Code Pro' style: Bold italic: family: 'Source Code Pro' style: Italic bold_italic: family: 'Source Code Pro' style: Bold Italic window: decorations: full # ボーダーとタイトルバーを表示する startup_mode: Fullscreen # フルスクリーンで起動する background_opacity: 0.95 # 背景を透過させるfish shellとtmuxを使用しているので、
shell
でAlacritty起動時にfish shellを使用して、tmuxのセッションが残っていた場合セッションにアタッチし、残っていなかった場合tmuxを実行するように指定しています。
colors
ではAlacrittyのテーマを指定できます。上記の設定ファイルではGruvbox
のカラースキームを指定していますが、Color schemes · alacritty/alacritty WikiでAlacritty用のカラースキームが公開されています。
font
では、フォントサイズと使用するフォントを指定しています。Souce Code Pro
はAdobeが開発したプログラミング用フォントでPowerlineフォントとしても利用できます。
window
とbackground_opacity
では、Alacrittyの見た目を変えています。その他の設定はconfig-alacritty/alacritty.yml at master · tmcdonell/config-alacrittyを参考にすると良いでしょう。
tmux, NeovimでTrue colorを有効にする
Alacrittyで、tmux、NeovimのTrue colorを有効にするにはAlacrittyとtmuxの設定が必要です。以下の設定をそれぞれの設定ファイルに追加しましょう。
$HOME/.config/alacritty/alacritty.ymlenv: TERM: alacritty$HOME/.tmux.confset -g default-terminal "screen-256color" set-option -sa terminal-overrides ',alacritty:RGB'Support "True" (24-bit) color · Issue #109 · alacritty/alacritty
参考サイト
- 投稿日:2020-10-24T10:53:47+09:00
Big Sur BetaでParallels Desktopのネットワークが接続できない問題を回避する方法
Big Surを先走ってBeta版インストールしたんですが、Parallels立ち上げると「ネットワークが起動できません?」とか言われるので暫定的な回避方法。
?
sudo -b /Applications/Parallels\ Desktop.app/Contents/MacOS/prl_client_app参考
https://forum.parallels.com/threads/network-initialization-failed.345647/page-4
- 投稿日:2020-10-24T00:51:02+09:00
catalinaにした途端git pullができなくなった
git pullしたら、
git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly! git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switchとかでた。
ああ、最近MacのOSアプデしたなと。
色々やったのですが、そもそもXcodeがインストールされてなかったので、
AppStoreからXcodeをインストールしたら治りました。