#  SPDX-FileCopyrightText: 2026 Damon Lynch <damonlynch@gmail.com>
#  SPDX-License-Identifier: GPL-3.0-or-later


from raphodo.tools.platformtools import get_gnome_setting, get_gnome_setting_subprocess


def gnome_prefer_dark() -> bool:
    """Return true if Gnome is set to run in dark mode"""
    try:
        return get_gnome_setting(setting="color-scheme") == "prefer-dark"
    except Exception:
        return False


def gnome_accent_color() -> str:
    """Return Gnome accent color or gtk-theme"""
    return get_gnome_setting_subprocess("accent-color") or get_gnome_setting_subprocess(
        "gtk-theme"
    )


if __name__ == "__main__":
    print(gnome_accent_color())
