Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tos-kamiya/832b4a570c654a957bf497d9460c8432 to your computer and use it in GitHub Desktop.
Save tos-kamiya/832b4a570c654a957bf497d9460c8432 to your computer and use it in GitHub Desktop.
Ubuntu 22.04 に Alacritty ターミナルを導入しよう 2022.11.07

Ubuntu 22.04 に Alacritty ターミナルを導入しよう 2022.11.07

インストール

UbuntuでAlacrittyを利用する場合、現状では フォントサイズの設定の設定に難がある ため、方法2を推奨

方法1: snapでインストール

sudo snap install alacritty --classic

方法2: cargoでインストール

Rustがインストールされていて ~/.cargo/bin にパスが通っている前提

(1) 先に依存関係をインストール

sudo apt install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev python3

(2) Alacrittyをインストール

cargo install alacritty

(3) メニューから起動できるように(.desktopの作成)

~/.local/share/applications/alacritty.desktop を作成し、次の中身にする

[Desktop Entry]
Name=Alacritty
Comment=A fast, cross-platform, OpenGL terminal emulator.
Keywords=shell;prompt;command;commandline;cmd;alacritty;
Exec=alacritty
Icon=Terminal
Type=Application
Categories=Utility;TerminalEmulator;
StartupNotify=false
Actions=new-window;

[Desktop Action new-window]
Name=New Window
Exec=alacritty

設定ファイルの配置

設定ディレクトリ ~/.config/alacritty/ を作成して、

Alacrittyリポジトリ https://github.com/alacritty/alacritty から、 alacritty.ymlを取ってきて、 ~/.config/alacritty/alacritty.yaml にコピー

テーマの設定

次の手順で Alacritty Themeリポジトリ https://github.com/eendroroy/alacritty-theme からテーマのファイルをダウンロードして配置

git clone https://github.com/eendroroy/alacritty-theme.git ~/.alacritty-colorscheme

レポジトリの見本からテーマを選んで、設定ファイル ~/.config/alacritty/alacritty.yaml に次を追加

import:
  - ~/.alacritty-colorscheme/themes/テーマの名前.yaml

その他の設定

好みに応じて、設定ファイルに記述を追加

ウィンドウの透明度

次の例では不透明度98%を設定

window:
  opacity: 0.98

フォントの設定

次の例では PlemolJP Console の Medium を設定

font:
  normal:
    family: 'PlemolJP Console'
    style: Medium

フォントサイズの設定

現在不具合があるらしい(参考: How to fix font size in alacritty?)ので、 コマンドラインオプションを指定することで回避

コマンドラインから起動する場合は:

alacritty -o font.size=14

上の .desktop ファイルの記述では、Exec=の行を修正する

Exec=alacritty -o font.size=14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment