Skip to content

Instantly share code, notes, and snippets.

@hoop33
Last active February 9, 2023 22:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoop33/06f2d5a9555997d739def91c2ab402b6 to your computer and use it in GitHub Desktop.
Save hoop33/06f2d5a9555997d739def91c2ab402b6 to your computer and use it in GitHub Desktop.
A shell function for displaying your kitty theme colors
# 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