Skip to content

Instantly share code, notes, and snippets.

@jstine35
Last active August 24, 2024 19:57
Show Gist options
  • Save jstine35/0c8a686d14fd1b078aa96adf2b54fc3c to your computer and use it in GitHub Desktop.
Save jstine35/0c8a686d14fd1b078aa96adf2b54fc3c to your computer and use it in GitHub Desktop.
Install Noto Emojis for Mintty on MSYS2
#!/bin/bash
[[ "$1" == --help ]] && SHOWHELP=1
(( SHOWHELP )) && {
echo "usage: install-emojis [/path/to/instance]"
echo
echo "Installs emojis at the system level for use by mintty."
echo "The brand of emoji installed are the Noto emojis from https://github.com/googlefonts/noto-emoji.git"
exit
}
instance_dir=$1
trap 'rm -rf /tmp/noto-emojis; exit 1' EXIT
[[ -d /tmp/noto-emojis ]] || {
git clone --filter=blob:none --no-checkout --depth 1 --sparse https://github.com/googlefonts/noto-emoji.git /tmp/noto-emojis
}
set -e
cd /tmp/noto-emojis
git -C /tmp/noto-emojis sparse-checkout add png/128
git -C /tmp/noto-emojis checkout
mkdir -p $instance_dir/usr/share/mintty/emojis/noto
mv -f /tmp/noto-emojis/png/128/* $instance_dir/usr/share/mintty/emojis/noto
cat << BOOKENDS
Installation Complete!
To enable the newly installed emojis, open ~/.minttyrc and add the following lines:
Emojis=noto
# recommended, when set to "Yes" many programs fail to display unicode.
ConPTY=no
# recommended, but not required.
EmojiPlacement=middle
BOOKENDS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment