Created
July 18, 2025 07:35
-
-
Save naranyala/d791b014c96024a78d8000217e97b17f to your computer and use it in GitHub Desktop.
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 -euo pipefail | |
| # ποΈ Ensure required directories exist | |
| mkdir -p ~/.local/share/fonts ~/.config/fontconfig/conf.d | |
| # π¨ Install emoji font | |
| echo "π₯ Installing Noto Color Emoji font..." | |
| sudo apt update | |
| sudo apt install -y fonts-noto-color-emoji | |
| # π οΈ Set up font fallback for emoji | |
| EMOJI_CONF=~/.config/fontconfig/conf.d/01-emoji.conf | |
| echo "π Configuring font fallback..." | |
| cat > "$EMOJI_CONF" <<EOF | |
| <?xml version="1.0"?> | |
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
| <fontconfig> | |
| <match target="pattern"> | |
| <test name="family"><string>Emoji</string></test> | |
| <edit name="family" mode="assign"><string>Noto Color Emoji</string></edit> | |
| </match> | |
| </fontconfig> | |
| EOF | |
| # π Coding fonts (install to ~/.local/share/fonts) | |
| FONT_URLS=( | |
| "https://github.com/tonsky/FiraCode/releases/download/6.2/Fira_Code_v6.2.zip" | |
| "https://download.jetbrains.com/fonts/JetBrainsMono-2.304.zip" | |
| "https://github.com/microsoft/cascadia-code/releases/download/v2404.23/CascadiaCode-2404.23.zip" | |
| ) | |
| echo "π₯ Downloading and extracting coding fonts..." | |
| TMPDIR=$(mktemp -d) | |
| cd "$TMPDIR" | |
| for URL in "${FONT_URLS[@]}"; do | |
| ZIP=$(basename "$URL") | |
| wget -q "$URL" -O "$ZIP" | |
| unzip -q "$ZIP" | |
| done | |
| # π― Move font files to ~/.local/share/fonts | |
| find . -type f \( -iname "*.ttf" -o -iname "*.otf" \) -exec mv {} ~/.local/share/fonts/ \; | |
| # π§Ή Clean up | |
| cd ~ | |
| rm -rf "$TMPDIR" | |
| # π Refresh font cache | |
| echo "π Rebuilding font cache..." | |
| fc-cache -fv | |
| echo "β Emoji and coding fonts installed successfully!" | |
| echo "π§ͺ Try: echo -e \"π π π―\" in your terminal to test emoji support." | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment