#!/bin/bash

[ -f "$HOME/.local/snippets/apply-color-helper" ] || {
    echo "Missing helper script: $HOME/.local/snippets/apply-color-helper"
    exit 1
}
. "$HOME/.local/snippets/apply-color-helper"

file="$path"/config/styles.kdl

sed -i -E "s/^(\s*active-color\s+\"#)([0-9A-Fa-f]{6})(\")/\1${colorHex}\3/g" "$file" || {
    log_error "Failed to edit ${file}"
    exit 1
}

log_success "niri"
