Skip to content

Add the color variation selector to emoji that need it! πŸ³οΈβ€πŸŒˆ

Notifications You must be signed in to change notification settings

valeriangalliat/force-color-emoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ³οΈβ€πŸŒˆ force-color-emoji

Add the color variation selector to emoji that need it!

Overview

Sometimes, you might notice monochrome emoji, for example ✌︎ instead of ✌️.

This is likely because this particular emoji needs an explicit Unicode variation selector to be displayed properly as an emoji instead of a monochrome glyph.

It seems that some emoji pickers don't always include the variation selector, and different systems have different defaults as for picking the monochrome or color variant when no selector is explicitly specified.

This program leverages ripgrep and the unicode-emoji-json package to identify emoji that need to include the variation selector to be properly displayed, and optionally add the variation selector in place.

Dependencies

ripgrep must be installed globally as rg.

apt install ripgrep
pacman -S ripgrep
brew install ripgrep

Usage

force-color-emoji [<path>...] [--fix-all]
force-color-emoji --fix

To list files that contain emoji missing the variation selector:

force-color-emoji

Uses the current directory by default. Specify one or more paths if you prefer:

force-color-emoji ~/blog

Fix all the identified emoji:

force-color-emoji --fix-all

Fix a subset of emoji:

force-color-emoji | grep ... | force-color-emoji --fix

Example

~/blog $ force-color-emoji
posts.md:πŸ•
2021/09/zoom-h2n-pro-tips-and-tricks.md:β„’
2021/09/totp-2fa-support-any-password-manager.md:🐿
2021/10/tent-sleeping-bag-packed-wet.md:πŸ•
2021/11/emoji-variation-selector.md:☹
2021/11/emoji-variation-selector.md:✍
2021/11/homebrew-multi-user.md:✌
2021/05/macos-screen-recording-with-system-audio.md:🎚
2021/05/macos-screen-recording-with-system-audio.md:πŸŽ›

~/blog $ force-color-emoji | grep -v 'β„’' | grep -v 2021/11/emoji-variation-selector.md
posts.md:πŸ•
2021/09/totp-2fa-support-any-password-manager.md:🐿
2021/10/tent-sleeping-bag-packed-wet.md:πŸ•
2021/11/homebrew-multi-user.md:✌
2021/05/macos-screen-recording-with-system-audio.md:🎚
2021/05/macos-screen-recording-with-system-audio.md:πŸŽ›

~/blog $ force-color-emoji | grep -v 'β„’' | grep -v 2021/11/emoji-variation-selector.md | force-color-emoji --fix
Wrote posts.md
Wrote 2021/09/totp-2fa-support-any-password-manager.md
Wrote 2021/10/tent-sleeping-bag-packed-wet.md
Wrote 2021/11/homebrew-multi-user.md
Wrote 2021/05/macos-screen-recording-with-system-audio.md

About

Add the color variation selector to emoji that need it! πŸ³οΈβ€πŸŒˆ

Resources

Stars

Watchers

Forks