#!/bin/bash
# See https://regolith-desktop.com/docs/howtos/customize-compositor/

compositor_PID=$(pidof compton)
if [ ! -z "$compositor_PID" ]; then
    kill $compositor_PID
fi

if [[ -f "$HOME/.config/regolith3/compton/config" ]]; then
  exec /usr/bin/compton -f --config "$HOME/.config/regolith3/compton/config"
else
  CONFIG_PATH=$(xrescat regolith.compositor.compton.config /etc/regolith/compton/config)
  exec /usr/bin/compton -f --config "$CONFIG_PATH"
fi
