# Generic defaults written once to ~/.config/DankMaterialShell/settings.json on first login.
# Hosts can override via `chiasson.desktop.shells.dms.defaultSeedDir` (see 14900k).
# After seeding, DMS settings are owned by the UI — rebuilds do not overwrite them.
#
# To refresh host seeds from live DMS config: `just sync-dms`
{
  lib,
  gpuTempEnabled ? true,
  extraRightBarWidgets ? [ ],
}:
let
  gpuTempBarWidget = {
    id = "gpuTemp";
    enabled = true;
    selectedGpuIndex = 0;
    pciId = "10de:1f07";
  };
in
{
  theme = "dark";
  dynamicTheming = true;
  currentThemeName = "dynamic";
  matugenScheme = "scheme-tonal-spot";
  runUserMatugenTemplates = true;
  matugenTemplateVesktop = false;
  showDock = false;
  gtkThemingEnabled = true;
  qtThemingEnabled = true;
  terminalsAlwaysDark = true;
  syncModeWithPortal = true;
  configVersion = 5;

  barConfigs = [
    {
      id = "default";
      name = "Main Bar";
      enabled = true;
      position = 0;
      screenPreferences = [ "all" ];
      showOnLastDisplay = true;

      leftWidgets =
        [
          {
            id = "launcherButton";
            enabled = true;
          }
          {
            id = "nixMonitor";
            enabled = true;
          }
          {
            id = "cpuUsage";
            enabled = true;
          }
          {
            id = "cpuTemp";
            enabled = true;
          }
        ]
        ++ lib.optionals gpuTempEnabled [ gpuTempBarWidget ]
        ++ [
          {
            id = "memUsage";
            enabled = true;
          }
        ];

      centerWidgets = [
        {
          id = "workspaceSwitcher";
          enabled = true;
        }
      ];

      rightWidgets = extraRightBarWidgets
        ++ [
          {
            id = "systemTray";
            enabled = true;
          }
          {
            id = "notificationButton";
            enabled = true;
          }
          {
            id = "battery";
            enabled = true;
          }
          {
            id = "controlCenterButton";
            enabled = true;
          }
          {
            id = "clock";
            enabled = true;
            clockCompactMode = false;
          }
        ];

      spacing = 0;
      innerPadding = 4;
      bottomGap = 0;
      transparency = 1;
      widgetTransparency = 0.45;
      squareCorners = true;
      maximizeDetection = true;
      visible = true;
    }
  ];
}
