-
-
Save Aaronmacaron/8a4e82ed0033290cb2e12d9df4e77efe to your computer and use it in GitHub Desktop.
| #!/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 | |
Thank u! If i want to change default from Alacarity to terminal default then do it?
Line 35 @namnguyen6595
Thanks a lot man!! This is really awesome!
to build using docker;
git clone https://github.com/alacritty/alacritty.git
cd alacritty
docker run -it --rm -v ${PWD}:/app -w /app rust:1 bash -c "apt update && apt install -y libxcb-xfixes0-dev && cargo build --release"
I ran into some issues with cargo install, but after a bit of trial-and-error I got it to work:
- Run
sudo apt updatebefore doing anything involving the APT command (it's technically not linked tocargo install, but it's a good practice). - On line 7, I recommend running
sudo apt install cmake libfreetype6-dev libfontconfig1-dev xclip cargo(First of all, there is no advantage usingapt-get install -yoverapt installon modern systems and second of all,cargodoesn't always come installed by default. My version of this command installs it.) - Lines 10 to 12 can be compressed into one -
cargo install --git https://github.com/alacritty/alacritty.git. It should also fix theerror: found a virtual manifest at '/home/(your-user-name)/alacritty/Cargo.toml' instead of a package manifesterror. (It should also be fixable using @kakposoe's solution (cd ..;cargo install --path alacritty/), but for whatever reason, it didn't work in my case.) On top of that, it eliminates the need to runcd..;rm -r alacrittyafter the installation.
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
cargo installdidn't work.The following worked.
sudo apt install libxcb-render0-dev libxcb-xfixes0-dev
cargo run --manifest-path Cargo.tomlAdditional 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
Missing crago into apt deps :)
Just a heads up. I was installing a fresh copy of ubuntu and installed cargo. I was unable to run
cargo installwithin the alacritty1 directory as it is no longer supported. I ended up removing thecdinto alacritty and usedcargo install --path alacritty/instead.Other issues occured but were dealt with separately.