For example for cases of switching between light and dark variants
On macOS it could be possible to implement switching themes with the macOS dark mode setting.
Notice that kitty already allows switching themes with the remote control protocol. See https://github.com/dexpota/kitty-themes/blob/master/README.md#previews for a script that makes this easy.
I dont know what you mean by a fast theme switcher. Changing colors in kitty is instantaneous and if you enable remote control you can change colors in any arbitrary set fo kitty windows. https://sw.kovidgoyal.net/kitty/faq.html#how-do-i-change-the-colors-in-a-running-kitty-instance
@askobara It's quite easy to implement this yourself with kitty's set-colors. I've implemented it for fish shell here as a theme command:
#!/usr/bin/env fish
function theme -d "Change kitty theme" -a theme_name
# Do nothing if there is no theme specified
if [ -z "$theme_name" ]
return
end
# Path to search for theme conf files
set -l theme_folder (command realpath ~/.dotfiles/themes/build)
# Full path to theme
set -l theme_path "$theme_folder/$theme_name.conf"
# If theme exists, change theme
if [ -e "$theme_path" ]
# Change for current session
kitty @ set-colors --all --configured $theme_path
end
end
And it even autocompletes the themes I have available:
#!/usr/bin/env fish
function theme_complete -d "Complete the theme command"
# Only completes first argument
if __fish_is_first_arg > /dev/null
# Path to search for theme conf files
set -l theme_folder (command realpath ~/.dotfiles/themes/build)
for theme in $theme_folder/*.conf
set -l theme_name (basename $theme .conf)
echo $theme_name
end
end
end
complete -c theme -fk -a "(theme_complete)"
This is of course geared to my setup, but it should be very doable to adapt this your shell/workflow of choice.
Most helpful comment
I dont know what you mean by a fast theme switcher. Changing colors in kitty is instantaneous and if you enable remote control you can change colors in any arbitrary set fo kitty windows. https://sw.kovidgoyal.net/kitty/faq.html#how-do-i-change-the-colors-in-a-running-kitty-instance