Skip to content

Instantly share code, notes, and snippets.

@Aaronmacaron
Last active October 10, 2022 11:26
Show Gist options
  • Save Aaronmacaron/8a4e82ed0033290cb2e12d9df4e77efe to your computer and use it in GitHub Desktop.
Save Aaronmacaron/8a4e82ed0033290cb2e12d9df4e77efe to your computer and use it in GitHub Desktop.
Install Alacritty on Ubuntu
#!/bin/bash
# This installs alacritty terminal on ubuntu (https://github.com/jwilm/alacritty)
# You have to have rust/cargo installed for this to work
# Install required tools
sudo apt-get install -y cmake libfreetype6-dev libfontconfig1-dev xclip
# Download, compile and install Alacritty
git clone https://github.com/jwilm/alacritty
cd alacritty
cargo install
# Add Man-Page entries
sudo mkdir -p /usr/local/share/man/man1
gzip -c alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null
# Add shell completion for bash and zsh
mkdir -p ~/.bash_completion
cp alacritty-completions.bash ~/.bash_completion/alacritty
echo "source ~/.bash_completion/alacritty" >> ~/.bashrc
sudo cp alacritty-completions.zsh /usr/share/zsh/functions/Completion/X/_alacritty
# Copy default config into home dir
cp alacritty.yml ~/.alacritty.yml
# Create desktop file
cp Alacritty.desktop ~/.local/share/applications/
# Copy binary to path
sudo cp target/release/alacritty /usr/local/bin
# Use Alacritty as default terminal (Ctrl + Alt + T)
gsettings set org.gnome.desktop.default-applications.terminal exec 'alacritty'
# Remove temporary dir
cd ..
rm -r alacritty
@hirosumee
Copy link

cargo install didn't work.

The following worked.
sudo apt install libxcb-render0-dev libxcb-xfixes0-dev
cargo run --manifest-path Cargo.toml

Additional changes:
gzip -c extra/alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null
cp extra/completions/alacritty.bash ~/.bash_completion/alacritty
cp extra/linux/Alacritty.desktop ~/.local/share/applications/
sudo cp target/debug/alacritty /usr/local/bin

thank you

@Dauliac
Copy link

Dauliac commented Jan 25, 2021

Missing crago into apt deps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment