Skip to content

Instantly share code, notes, and snippets.

@ianfabs
Last active September 15, 2024 19:10
Show Gist options
  • Save ianfabs/0877bd6de3b34c3fae5fbaceb073fc93 to your computer and use it in GitHub Desktop.
Save ianfabs/0877bd6de3b34c3fae5fbaceb073fc93 to your computer and use it in GitHub Desktop.
Kittens for kitty-themes!
kitten_alias ~/.config/kitty/try-theme.py try-theme
kitten_alias ~/.config/kitty/set-theme.py set-theme
#!/usr/bin/env python3
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
import sys
import subprocess
from typing import List
def main(args: List[str] = sys.argv):
theme = args[1]
if not theme:
theme = input("Theme: ")
theme = theme.replace(' ', '_')
command = 'ln -sf /home/ian/.config/kitty/kitty-themes/themes/{}.conf /home/ian/.config/kitty/theme.conf'.format(theme)
subprocess.run(command.split(' '))
pass
#!/usr/bin/env python3
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
from sys import argv
from subprocess import run
from typing import List
def main(args: List[str] = argv):
theme = args[1]
if not theme:
theme = input("Theme: ")
theme = theme.replace(' ', '_')
command = 'kitty @ set-colors -a /home/ian/.config/kitty/kitty-themes/themes/{}.conf'.format(theme)
run(command.split(' '))
pass
@ianfabs
Copy link
Author

ianfabs commented Sep 15, 2024

Kitty themes repository:

git clone --depth 1 [email protected]:dexpota/kitty-themes.git ~/.config/kitty/kitty-themes

@ianfabs
Copy link
Author

ianfabs commented Sep 15, 2024

Command to change the current theme in kitty (Change THEME='' to the name of the theme file you want to try):

THEME='';kitty @ set-colors -a "~/.config/kitty/kitty-themes/themes/$THEME.conf"

To show the colors for the current theme (sudo apt install jq if missing):

COLOR_SCRIPT_REPO=https://api.github.com/repos/stark/Color-Scripts/contents/color-scripts;wget -q -O - $(curl -s $COLOR_SCRIPT_REPO | jq '.[] | "\(.path) \(.download_url)"' -r | shuf -n1 | cut -d " " -f2) | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment