-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Description
With below simple script it's easier to choose your favorite theme.
Note:
- This requires
allow_remote_control yes
in yourkitty.conf
- Save below to file named "random_kitty" and run
sudo chmod +x random_kitty". Then you can execute it with
./random_kitty` or add it to your path.
#!/usr/bin/python
import os
import random
import subprocess
home = os.getenv("HOME")
kitty = f"{home}/.config/kitty"
choices_dir = f"{kitty}/kitty-themes/themes"
choices = os.listdir(choices_dir)
dest = f"{kitty}/theme.conf"
if os.path.islink(dest):
os.remove(dest)
new_theme = random.choice(choices)
new_theme_path = f"{choices_dir}/{new_theme}"
os.symlink(new_theme_path, dest)
command = f"kitty @ set-colors -a -c {kitty}/kitty.conf"
subprocess.run(command, shell=True)
print(f"Kitty theme set to {new_theme}")
luisdavim
Metadata
Metadata
Assignees
Labels
No labels