summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/dms/Common/settings/SessionSpec.js
blob: e2bb4fe8d22fb4c3a8aee7e5f0b7953813cc75df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.pragma library

var SPEC = {
    isLightMode: { def: false },
    doNotDisturb: { def: false },

    wallpaperPath: { def: "" },
    perMonitorWallpaper: { def: false },
    monitorWallpapers: { def: {} },
    perModeWallpaper: { def: false },
    wallpaperPathLight: { def: "" },
    wallpaperPathDark: { def: "" },
    monitorWallpapersLight: { def: {} },
    monitorWallpapersDark: { def: {} },
    monitorWallpaperFillModes: { def: {} },
    wallpaperTransition: { def: "fade" },
    includedTransitions: { def: ["fade", "wipe", "disc", "stripes", "iris bloom", "pixelate", "portal"] },

    wallpaperCyclingEnabled: { def: false },
    wallpaperCyclingMode: { def: "interval" },
    wallpaperCyclingInterval: { def: 300 },
    wallpaperCyclingTime: { def: "06:00" },
    monitorCyclingSettings: { def: {} },

    nightModeEnabled: { def: false },
    nightModeTemperature: { def: 4500 },
    nightModeHighTemperature: { def: 6500 },
    nightModeAutoEnabled: { def: false },
    nightModeAutoMode: { def: "time" },
    nightModeStartHour: { def: 18 },
    nightModeStartMinute: { def: 0 },
    nightModeEndHour: { def: 6 },
    nightModeEndMinute: { def: 0 },
    latitude: { def: 0.0 },
    longitude: { def: 0.0 },
    nightModeUseIPLocation: { def: false },
    nightModeLocationProvider: { def: "" },

    themeModeAutoEnabled: { def: false },
    themeModeAutoMode: { def: "time" },
    themeModeStartHour: { def: 18 },
    themeModeStartMinute: { def: 0 },
    themeModeEndHour: { def: 6 },
    themeModeEndMinute: { def: 0 },
    themeModeShareGammaSettings: { def: true },

    weatherLocation: { def: "New York, NY" },
    weatherCoordinates: { def: "40.7128,-74.0060" },

    pinnedApps: { def: [] },
    barPinnedApps: { def: [] },
    dockLauncherPosition: { def: 0 },
    hiddenTrayIds: { def: [] },
    trayItemOrder: { def: [] },
    recentColors: { def: [] },
    showThirdPartyPlugins: { def: false },
    launchPrefix: { def: "" },
    lastBrightnessDevice: { def: "" },

    brightnessExponentialDevices: { def: {} },
    brightnessUserSetValues: { def: {} },
    brightnessExponentValues: { def: {} },

    selectedGpuIndex: { def: 0 },
    nvidiaGpuTempEnabled: { def: false },
    nonNvidiaGpuTempEnabled: { def: false },
    enabledGpuPciIds: { def: [] },

    wifiDeviceOverride: { def: "" },
    weatherHourlyDetailed: { def: true },

    hiddenApps: { def: [] },
    appOverrides: { def: {} },
    searchAppActions: { def: true },

    vpnLastConnected: { def: "" },

    lastPlayerIdentity: { def: "" },

    deviceMaxVolumes: { def: {} },
    hiddenOutputDeviceNames: { def: [] },
    hiddenInputDeviceNames: { def: [] },

    locale: { def: "", onChange: "updateLocale" },
    timeLocale: { def: "" },

    launcherLastMode: { def: "all" },
    launcherLastQuery: { def: "" },
    launcherQueryHistory: { def: [] },
    appDrawerLastMode: { def: "apps" },
    niriOverviewLastMode: { def: "apps" },

    settingsSidebarExpandedIds: { def: "," },
    settingsSidebarCollapsedIds: { def: "," }
};

function getValidKeys() {
    return Object.keys(SPEC).concat(["configVersion"]);
}

function set(root, key, value, saveFn, hooks) {
    if (!(key in SPEC)) return;
    root[key] = value;
    var hookName = SPEC[key].onChange;
    if (hookName && hooks && hooks[hookName]) {
        hooks[hookName](root);
    }
    saveFn();
}