// ── violet-chaton v2 — AGS config ───────────────────────────────────────────
// Barre + OSD + Launcher + Notifications
// Modulaire : Hyprland = full, COSMIC = bar + OSD + launcher + notifs

import { Bar } from "./widgets/Bar.js";
import { OSD } from "./widgets/OSD.js";
import { Launcher } from "./widgets/Launcher.js";
import { Notifications } from "./widgets/Notifications.js";

// ── Compositor detection ────────────────────────────────────────────────────
const compositor = (() => {
    const session = Utils.exec("echo $XDG_CURRENT_DESKTOP").trim();
    if (session.includes("Hyprland")) return "hyprland";
    if (session.includes("COSMIC")) return "cosmic";
    return "unknown";
})();

print(`[violet-chaton] compositor: ${compositor}`);

// ── Windows ─────────────────────────────────────────────────────────────────
const windows = (monitor) => {
    const wins = [
        Bar(monitor, compositor),
        OSD(monitor),
        Launcher(monitor),
        Notifications(monitor),
    ];
    return wins;
};

export default {
    style: `${App.configDir}/css/style.css`,
    windows: windows(0).flat(),
};
