Last active
February 9, 2023 22:26
-
-
Save hoop33/06f2d5a9555997d739def91c2ab402b6 to your computer and use it in GitHub Desktop.
A shell function for displaying your kitty theme colors
This file contains 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
# Prerequisites: | |
# kitty: https://sw.kovidgoyal.net/kitty/ | |
# kitty themes: https://github.com/dexpota/kitty-themes | |
# pastel: https://github.com/sharkdp/pastel | |
# Usage: | |
# $ kittycolors | |
# $ kittycolors -s | |
kittycolors() { | |
if [[ $# -eq 0 ]]; then | |
grep -o "#[a-f0-9]\{6\}" ~/.config/kitty/current-theme.conf | pastel color | |
else | |
case $1 in | |
short|--short|-s) for COLOR in $(grep -o "#[a-f0-9]\{6\}" ~/.config/kitty/current-theme.conf); do pastel paint $(pastel textcolor $COLOR) --on $COLOR "$COLOR "; done ;; | |
*) echo "usage: kittycolors [-s]" ;; | |
esac | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment