#!/bin/bash

appearance=$(defaults read -g AppleInterfaceStyle 2>/dev/null)

if [[ "$appearance" = "Dark" ]]; then
    skin="default-dark"
else
    skin="default-light"
fi

config_file="$HOME/doc/dev/dotfiles/k9s/.config/k9s/config.yaml"

if [[ -f "$config_file" ]]; then
    sed -i '' "s/skin: .*/skin: $skin/" "$config_file"
fi

exec k9s "$@"
