#!/usr/bin/env sh

set -eu

IFS="$(printf ' \t')
"

file="$1"
current="$(tinty current variant)"

if [ "${current}" = dark ]; then
  theme="Dark"
else
  theme="Light"
fi

# shellcheck disable=SC2140
case ${theme} in
  Dark) printf "\n[window]\ndecorations_theme_variant = "\"Dark"\"\n" >> "${file}"
    ;;
  Light) printf "\n[window]\ndecorations_theme_variant = "\"Light"\"\n" >> "${file}"
    ;;
  *) error "Need output file to write"
    ;;
esac
