Created
July 5, 2026 10:52
-
-
Save michelesr/999396d7ec09621de2f67d8d805866ee to your computer and use it in GitHub Desktop.
Install and update Alacritty in Mac OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e -o pipefail | |
| app_name='Alacritty' | |
| owner='alacritty' | |
| repo='alacritty' | |
| version=$(curl -s "https://api.github.com/repos/${owner}/${repo}/releases/latest" | jq -r .tag_name) | |
| filename="${app_name}-${version}.dmg" | |
| prefix=$(brew --prefix 2>/dev/null) | |
| resources="/Applications/${app_name}.app/Contents/Resources" | |
| cd ~/Downloads | |
| if [ -e "${filename}" ]; then | |
| echo "${filename} exists already, aborting. Delete it to force installation" | |
| exit 1 | |
| fi | |
| echo "Downloading ${filename}" | |
| curl -L -O "https://github.com/${owner}/${repo}/releases/download/${version}/${filename}" | |
| echo 'Mounting image...' | |
| hdiutil attach ${filename} | |
| path="/Applications/${app_name}.app/" | |
| echo "Installing to ${path}" | |
| rsync -a "/Volumes/${app_name}/${app_name}.app/" "${path}" | |
| echo 'Unmounting image...' | |
| hdiutil detach "/Volumes/${app_name}" | |
| echo 'Bypassing Gatekeeper quarantine...' | |
| xattr -rd com.apple.quarantine "/Applications/${app_name}.app" | |
| echo 'Copying terminfo...' | |
| mkdir -p ~/.terminfo/61/ | |
| rsync -a ${resources}/61/ ~/.terminfo/61/ | |
| echo 'Copying man pages...' | |
| mkdir -p "${prefix}/share/man/man1" "${prefix}/share/man/man5" | |
| rsync -a "${resources}"/*.1.gz "${prefix}/share/man/man1/" | |
| rsync -a "${resources}"/*.5.gz "${prefix}/share/man/man5/" | |
| echo 'Copying zsh completions...' | |
| mkdir -p "${prefix}/share/zsh/site-functions" | |
| rsync -a "${resources}/completions/_alacritty" "${prefix}/share/zsh/site-functions/" | |
| echo 'Copying bash completions...' | |
| mkdir -p "${prefix}/etc/bash_completion.d" | |
| rsync -a "${resources}/completions/alacritty.bash" "${prefix}/etc/bash_completion.d/" | |
| echo 'Cleaning up...' | |
| rm "${filename}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment