cargo安装

如果只需要一个alacritty的可执行文件的话,可以直接使用cargo安装

  1. # 安装cargo
  2. sudo apt install cargo
  3. # 国内需要配置cargo的国内源,下面编译安装同样需要
  4. # 创建~/.cargo/config并写入以下内容
  5. [source.crates-io]
  6. registry = "https://github.com/rust-lang/crates.io-index"
  7. replace-with = 'ustc'
  8. [source.ustc]
  9. registry = "git://mirrors.ustc.edu.cn/crates.io-index"
  10. # 安装alacritty
  11. cargo install alacritty
  12. # 最后生成的可执行文件在~/.cargo/bin/alacritty, 需要将它复制到PATH中

编译安装

  1. # 克隆
  2. git clone https://gitee.com/yaozhijin/alacritty.git
  3. # Ubuntu安装dependencies
  4. sudo apt-get install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev python3 cargo build-essential
  5. # 编译
  6. cd alacritty
  7. cargo build --release #编译好后的文件在target/release/alacritty
  8. # 安装到系统,并生成桌面图标
  9. sudo cp target/release/alacritty /usr/local/bin # or anywhere else in $PATH
  10. sudo cp extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg
  11. sudo desktop-file-install extra/linux/Alacritty.desktop
  12. sudo update-desktop-database

配置文件为~/.config/alacritty/alacritty.yml,需自己创建,仓库中有模板,我的配置文件请到此处下载