#!/bin/sh # The kitty *-theme.auto.conf files are generated from .config/kitty/themes and # the per-machine .config/kitty/theme-mode, both of which .chezmoiignore keeps # out of the source state. Regenerate them here so a freshly applied machine # ends up with theme files kitty can read. # # apply-theme-mode.sh is idempotent, and defaults to `auto` when there is no # theme-mode file, so a new machine simply follows its OS until told otherwise. set -eu config_dir="${KITTY_CONFIG_DIRECTORY:-$HOME/.config/kitty}" apply="$config_dir/apply-theme-mode.sh" # Nothing to do on machines without this kitty config applied. [ -x "$apply" ] || exit 0 [ -d "$config_dir/themes" ] || exit 0 # Never let a theming problem fail the whole apply. if ! "$apply" "$config_dir"; then echo "warning: could not regenerate kitty theme files" >&2 fi exit 0