mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
greeter: migrated dms-greeter to github/AvengeMedia/dank-greeter
This commit is contained in:
@@ -13,8 +13,6 @@ Singleton {
|
||||
|
||||
readonly property int cacheConfigVersion: 1
|
||||
|
||||
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
||||
|
||||
readonly property string _stateUrl: StandardPaths.writableLocation(StandardPaths.GenericCacheLocation)
|
||||
readonly property string _stateDir: Paths.strip(_stateUrl)
|
||||
|
||||
@@ -75,9 +73,7 @@ Singleton {
|
||||
})
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!isGreeterMode) {
|
||||
loadCache();
|
||||
}
|
||||
loadCache();
|
||||
}
|
||||
|
||||
function loadCache() {
|
||||
@@ -200,7 +196,7 @@ Singleton {
|
||||
FileView {
|
||||
id: launcherCacheFile
|
||||
|
||||
path: isGreeterMode ? "" : _stateDir + "/DankMaterialShell/launcher_cache.json"
|
||||
path: _stateDir + "/DankMaterialShell/launcher_cache.json"
|
||||
blockLoading: true
|
||||
blockWrites: true
|
||||
atomicWrites: true
|
||||
@@ -210,20 +206,16 @@ Singleton {
|
||||
FileView {
|
||||
id: cacheFile
|
||||
|
||||
path: isGreeterMode ? "" : _stateDir + "/DankMaterialShell/cache.json"
|
||||
path: _stateDir + "/DankMaterialShell/cache.json"
|
||||
blockLoading: true
|
||||
blockWrites: true
|
||||
atomicWrites: true
|
||||
watchChanges: !isGreeterMode
|
||||
watchChanges: true
|
||||
onLoaded: {
|
||||
if (!isGreeterMode) {
|
||||
parseCache(cacheFile.text());
|
||||
}
|
||||
parseCache(cacheFile.text());
|
||||
}
|
||||
onLoadFailed: error => {
|
||||
if (!isGreeterMode) {
|
||||
log.info("No cache file found, starting fresh");
|
||||
}
|
||||
log.info("No cache file found, starting fresh");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
.pragma library
|
||||
|
||||
// English language name -> ISO 639-1 code, for abbreviating xkb layout names.
|
||||
const LANG_CODES = {
|
||||
"afrikaans": "af",
|
||||
"albanian": "sq",
|
||||
"amharic": "am",
|
||||
"arabic": "ar",
|
||||
"armenian": "hy",
|
||||
"azerbaijani": "az",
|
||||
"basque": "eu",
|
||||
"belarusian": "be",
|
||||
"bengali": "bn",
|
||||
"bosnian": "bs",
|
||||
"bulgarian": "bg",
|
||||
"burmese": "my",
|
||||
"catalan": "ca",
|
||||
"chinese": "zh",
|
||||
"croatian": "hr",
|
||||
"czech": "cs",
|
||||
"danish": "da",
|
||||
"dutch": "nl",
|
||||
"english": "en",
|
||||
"esperanto": "eo",
|
||||
"estonian": "et",
|
||||
"filipino": "fil",
|
||||
"finnish": "fi",
|
||||
"french": "fr",
|
||||
"galician": "gl",
|
||||
"georgian": "ka",
|
||||
"german": "de",
|
||||
"greek": "el",
|
||||
"gujarati": "gu",
|
||||
"hausa": "ha",
|
||||
"hebrew": "he",
|
||||
"hindi": "hi",
|
||||
"hungarian": "hu",
|
||||
"icelandic": "is",
|
||||
"igbo": "ig",
|
||||
"indonesian": "id",
|
||||
"irish": "ga",
|
||||
"italian": "it",
|
||||
"japanese": "ja",
|
||||
"javanese": "jv",
|
||||
"kannada": "kn",
|
||||
"kazakh": "kk",
|
||||
"khmer": "km",
|
||||
"korean": "ko",
|
||||
"kurdish": "ku",
|
||||
"kyrgyz": "ky",
|
||||
"lao": "lo",
|
||||
"latvian": "lv",
|
||||
"lithuanian": "lt",
|
||||
"luxembourgish": "lb",
|
||||
"macedonian": "mk",
|
||||
"malay": "ms",
|
||||
"malayalam": "ml",
|
||||
"maltese": "mt",
|
||||
"maori": "mi",
|
||||
"marathi": "mr",
|
||||
"mongolian": "mn",
|
||||
"nepali": "ne",
|
||||
"norwegian": "no",
|
||||
"pashto": "ps",
|
||||
"persian": "fa",
|
||||
"iranian": "fa",
|
||||
"farsi": "fa",
|
||||
"polish": "pl",
|
||||
"portuguese": "pt",
|
||||
"punjabi": "pa",
|
||||
"romanian": "ro",
|
||||
"russian": "ru",
|
||||
"serbian": "sr",
|
||||
"sindhi": "sd",
|
||||
"sinhala": "si",
|
||||
"slovak": "sk",
|
||||
"slovenian": "sl",
|
||||
"somali": "so",
|
||||
"spanish": "es",
|
||||
"swahili": "sw",
|
||||
"swedish": "sv",
|
||||
"tajik": "tg",
|
||||
"tamil": "ta",
|
||||
"tatar": "tt",
|
||||
"telugu": "te",
|
||||
"thai": "th",
|
||||
"tibetan": "bo",
|
||||
"turkish": "tr",
|
||||
"turkmen": "tk",
|
||||
"ukrainian": "uk",
|
||||
"urdu": "ur",
|
||||
"uyghur": "ug",
|
||||
"uzbek": "uz",
|
||||
"vietnamese": "vi",
|
||||
"welsh": "cy",
|
||||
"yiddish": "yi",
|
||||
"yoruba": "yo",
|
||||
"zulu": "zu"
|
||||
};
|
||||
|
||||
function layoutCode(layoutName) {
|
||||
if (!layoutName)
|
||||
return "";
|
||||
const lang = layoutName.split(" ")[0].toLowerCase();
|
||||
const code = LANG_CODES[lang] || lang.substring(0, 2);
|
||||
return code.toUpperCase();
|
||||
}
|
||||
@@ -16,7 +16,6 @@ Singleton {
|
||||
|
||||
readonly property int sessionConfigVersion: 3
|
||||
|
||||
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
||||
property bool _parseError: false
|
||||
property bool _hasLoaded: false
|
||||
property bool _isReadOnly: false
|
||||
@@ -227,9 +226,7 @@ Singleton {
|
||||
property string settingsSidebarCollapsedIds: ","
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!isGreeterMode) {
|
||||
loadSettings();
|
||||
}
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
property var _pendingMigration: null
|
||||
@@ -238,11 +235,6 @@ Singleton {
|
||||
_hasUnsavedChanges = false;
|
||||
_pendingMigration = null;
|
||||
|
||||
if (isGreeterMode) {
|
||||
parseSettings(greeterSessionFile.text());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const txt = settingsFile.text();
|
||||
let obj = (txt && txt.trim()) ? JSON.parse(txt) : null;
|
||||
@@ -280,7 +272,7 @@ Singleton {
|
||||
_loadedSessionSnapshot = getCurrentSessionJson();
|
||||
_hasLoaded = true;
|
||||
|
||||
if (!isGreeterMode && typeof Theme !== "undefined")
|
||||
if (typeof Theme !== "undefined")
|
||||
Theme.generateSystemThemesFromCurrentTheme();
|
||||
|
||||
if (typeof WallpaperCyclingService !== "undefined")
|
||||
@@ -362,7 +354,7 @@ Singleton {
|
||||
_loadedSessionSnapshot = getCurrentSessionJson();
|
||||
_hasLoaded = true;
|
||||
|
||||
if (!isGreeterMode && typeof Theme !== "undefined")
|
||||
if (typeof Theme !== "undefined")
|
||||
Theme.generateSystemThemesFromCurrentTheme();
|
||||
|
||||
if (typeof WallpaperCyclingService !== "undefined")
|
||||
@@ -386,7 +378,7 @@ Singleton {
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
if (isGreeterMode || _parseError || !_hasLoaded)
|
||||
if (_parseError || !_hasLoaded)
|
||||
return;
|
||||
settingsFile.setText(getCurrentSessionJson());
|
||||
if (_isReadOnly)
|
||||
@@ -1394,16 +1386,14 @@ Singleton {
|
||||
FileView {
|
||||
id: settingsFile
|
||||
|
||||
path: isGreeterMode ? "" : StandardPaths.writableLocation(StandardPaths.GenericStateLocation) + "/DankMaterialShell/session.json"
|
||||
path: StandardPaths.writableLocation(StandardPaths.GenericStateLocation) + "/DankMaterialShell/session.json"
|
||||
blockLoading: true
|
||||
blockWrites: true
|
||||
atomicWrites: true
|
||||
watchChanges: !isGreeterMode
|
||||
watchChanges: true
|
||||
onLoaded: {
|
||||
if (!isGreeterMode) {
|
||||
_hasUnsavedChanges = false;
|
||||
parseSettings(settingsFile.text());
|
||||
}
|
||||
_hasUnsavedChanges = false;
|
||||
parseSettings(settingsFile.text());
|
||||
}
|
||||
onSaveFailed: error => {
|
||||
root._isReadOnly = true;
|
||||
@@ -1411,39 +1401,6 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string _greeterCacheDir: Quickshell.env("DMS_GREET_CFG_DIR") || "/var/cache/dms-greeter"
|
||||
|
||||
property string greeterSessionBaseDir: root._greeterCacheDir
|
||||
|
||||
function setGreeterSessionBaseDir(dir) {
|
||||
const next = dir || root._greeterCacheDir;
|
||||
if (greeterSessionBaseDir === next)
|
||||
return;
|
||||
greeterSessionBaseDir = next;
|
||||
if (isGreeterMode)
|
||||
greeterSessionFile.reload();
|
||||
}
|
||||
|
||||
function resetGreeterSessionBaseDir() {
|
||||
setGreeterSessionBaseDir(root._greeterCacheDir);
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: greeterSessionFile
|
||||
|
||||
path: root.greeterSessionBaseDir ? (root.greeterSessionBaseDir + "/session.json") : ""
|
||||
preload: isGreeterMode
|
||||
blockLoading: false
|
||||
blockWrites: true
|
||||
watchChanges: false
|
||||
printErrors: true
|
||||
onLoaded: {
|
||||
if (isGreeterMode) {
|
||||
parseSettings(greeterSessionFile.text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: sessionWritableCheckProcess
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ Singleton {
|
||||
|
||||
readonly property int settingsConfigVersion: 12
|
||||
|
||||
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
||||
|
||||
enum Position {
|
||||
Top,
|
||||
Bottom,
|
||||
@@ -1439,19 +1437,15 @@ Singleton {
|
||||
signal workspaceIconsUpdated
|
||||
|
||||
function refreshAuthAvailability() {
|
||||
if (isGreeterMode)
|
||||
return;
|
||||
Processes.detectAuthCapabilities();
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!isGreeterMode) {
|
||||
Processes.settingsRoot = root;
|
||||
loadSettings();
|
||||
initializeListModels();
|
||||
refreshAuthAvailability();
|
||||
Processes.checkPluginSettings();
|
||||
}
|
||||
Processes.settingsRoot = root;
|
||||
loadSettings();
|
||||
initializeListModels();
|
||||
refreshAuthAvailability();
|
||||
Processes.checkPluginSettings();
|
||||
}
|
||||
|
||||
function applyStoredTheme() {
|
||||
@@ -1517,8 +1511,6 @@ Singleton {
|
||||
}
|
||||
|
||||
function checkIconThemeDrift() {
|
||||
if (isGreeterMode)
|
||||
return;
|
||||
if (resolveIconTheme() === "System Default")
|
||||
return;
|
||||
if (!lastAppliedIconTheme)
|
||||
@@ -1674,8 +1666,6 @@ Singleton {
|
||||
}
|
||||
|
||||
function scheduleAuthApply() {
|
||||
if (isGreeterMode)
|
||||
return;
|
||||
Qt.callLater(() => {
|
||||
Processes.settingsRoot = root;
|
||||
Processes.scheduleAuthApply();
|
||||
@@ -1683,8 +1673,6 @@ Singleton {
|
||||
}
|
||||
|
||||
function scheduleGreeterAutoLoginSync() {
|
||||
if (isGreeterMode)
|
||||
return;
|
||||
Qt.callLater(() => {
|
||||
Processes.settingsRoot = root;
|
||||
Processes.scheduleGreeterAutoLoginSync();
|
||||
@@ -1692,8 +1680,6 @@ Singleton {
|
||||
}
|
||||
|
||||
function markGreeterSyncPending(who, key, oldValue) {
|
||||
if (isGreeterMode)
|
||||
return;
|
||||
if (!(key in greeterSyncBaseline)) {
|
||||
var baseline = greeterSyncBaseline;
|
||||
baseline[key] = oldValue;
|
||||
@@ -3632,7 +3618,7 @@ Singleton {
|
||||
FileView {
|
||||
id: settingsFile
|
||||
|
||||
path: isGreeterMode ? "" : StandardPaths.writableLocation(StandardPaths.ConfigLocation) + "/DankMaterialShell/settings.json"
|
||||
path: StandardPaths.writableLocation(StandardPaths.ConfigLocation) + "/DankMaterialShell/settings.json"
|
||||
blockLoading: true
|
||||
blockWrites: true
|
||||
atomicWrites: true
|
||||
@@ -3645,8 +3631,6 @@ Singleton {
|
||||
settingsFileReloadDebounce.restart();
|
||||
}
|
||||
onLoaded: {
|
||||
if (isGreeterMode)
|
||||
return;
|
||||
const wasLoaded = _hasLoaded;
|
||||
const prevFrameEnabled = frameEnabled;
|
||||
const prevFrameMode = frameMode;
|
||||
@@ -3689,9 +3673,7 @@ Singleton {
|
||||
updateFrameCompositorLayout();
|
||||
}
|
||||
onLoadFailed: error => {
|
||||
if (!isGreeterMode) {
|
||||
applyStoredTheme();
|
||||
}
|
||||
applyStoredTheme();
|
||||
}
|
||||
onSaveFailed: error => {
|
||||
root._isReadOnly = true;
|
||||
@@ -3702,24 +3684,20 @@ Singleton {
|
||||
FileView {
|
||||
id: pluginSettingsFile
|
||||
|
||||
path: isGreeterMode ? "" : pluginSettingsPath
|
||||
path: pluginSettingsPath
|
||||
blockLoading: true
|
||||
blockWrites: true
|
||||
atomicWrites: true
|
||||
printErrors: false
|
||||
watchChanges: !isGreeterMode
|
||||
watchChanges: true
|
||||
onLoaded: {
|
||||
if (!isGreeterMode) {
|
||||
parsePluginSettings(pluginSettingsFile.text());
|
||||
}
|
||||
parsePluginSettings(pluginSettingsFile.text());
|
||||
}
|
||||
onLoadFailed: error => {
|
||||
if (!isGreeterMode) {
|
||||
const msg = String(error || "");
|
||||
if (!_isMissingPluginSettingsError(error))
|
||||
log.warn("Failed to load plugin_settings.json. Error:", msg);
|
||||
_resetPluginSettings();
|
||||
}
|
||||
const msg = String(error || "");
|
||||
if (!_isMissingPluginSettingsError(error))
|
||||
log.warn("Failed to load plugin_settings.json. Error:", msg);
|
||||
_resetPluginSettings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-92
@@ -8,7 +8,6 @@ import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.DankCommon.Common as DankCommon
|
||||
import qs.Services
|
||||
import qs.Modules.Greetd
|
||||
import "StockThemes.js" as StockThemes
|
||||
|
||||
Singleton {
|
||||
@@ -143,13 +142,11 @@ Singleton {
|
||||
|
||||
Component.onCompleted: {
|
||||
Quickshell.execDetached(["mkdir", "-p", stateDir]);
|
||||
if (typeof SessionData === "undefined" || !SessionData.isGreeterMode)
|
||||
Quickshell.execDetached([shellDir + "/scripts/gtk.sh", configDir, "", shellDir, "assets-only"]);
|
||||
Quickshell.execDetached([shellDir + "/scripts/gtk.sh", configDir, "", shellDir, "assets-only"]);
|
||||
Proc.runCommand("matugenCheck", ["sh", "-c", "command -v matugen"], (output, code) => {
|
||||
matugenAvailable = (code === 0) && !envDisableMatugen;
|
||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode);
|
||||
|
||||
if (!matugenAvailable || isGreeterMode) {
|
||||
if (!matugenAvailable) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -428,13 +425,6 @@ Singleton {
|
||||
DMSService.sendRequest("theme.auto.trigger", {});
|
||||
}
|
||||
|
||||
function applyGreeterTheme(themeName) {
|
||||
switchTheme(themeName, false, false);
|
||||
if (themeName === dynamic && dynamicColorsFileView.path) {
|
||||
dynamicColorsFileView.reload();
|
||||
}
|
||||
}
|
||||
|
||||
function getMatugenColor(path, fallback) {
|
||||
const colorMode = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "light" : "dark";
|
||||
let cur = matugenColors && matugenColors.colors && matugenColors.colors[colorMode];
|
||||
@@ -1222,26 +1212,11 @@ Singleton {
|
||||
return presetMap[SettingsData.modalAnimationSpeed] ?? 150;
|
||||
}
|
||||
|
||||
property real cornerRadius: {
|
||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||
return GreetdSettings.cornerRadius;
|
||||
}
|
||||
return typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12;
|
||||
}
|
||||
property real cornerRadius: typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12
|
||||
|
||||
property string fontFamily: {
|
||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||
return resolvedFontFamily(GreetdSettings.getEffectiveFontFamily());
|
||||
}
|
||||
return typeof SettingsData !== "undefined" ? resolvedFontFamily(SettingsData.fontFamily) : DankCommon.Fonts.sans;
|
||||
}
|
||||
property string fontFamily: typeof SettingsData !== "undefined" ? resolvedFontFamily(SettingsData.fontFamily) : DankCommon.Fonts.sans
|
||||
|
||||
property string monoFontFamily: {
|
||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||
return resolvedMonoFontFamily(GreetdSettings.monoFontFamily);
|
||||
}
|
||||
return typeof SettingsData !== "undefined" ? resolvedMonoFontFamily(SettingsData.monoFontFamily) : DankCommon.Fonts.mono;
|
||||
}
|
||||
property string monoFontFamily: typeof SettingsData !== "undefined" ? resolvedMonoFontFamily(SettingsData.monoFontFamily) : DankCommon.Fonts.mono
|
||||
|
||||
function resolvedFontFamily(family) {
|
||||
if (family === defaultFontFamily)
|
||||
@@ -1255,19 +1230,9 @@ Singleton {
|
||||
return family;
|
||||
}
|
||||
|
||||
property int fontWeight: {
|
||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||
return GreetdSettings.fontWeight;
|
||||
}
|
||||
return typeof SettingsData !== "undefined" ? SettingsData.fontWeight : Font.Normal;
|
||||
}
|
||||
property int fontWeight: typeof SettingsData !== "undefined" ? SettingsData.fontWeight : Font.Normal
|
||||
|
||||
property real fontScale: {
|
||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||
return GreetdSettings.fontScale;
|
||||
}
|
||||
return typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0;
|
||||
}
|
||||
property real fontScale: typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0
|
||||
|
||||
property real spacingXXS: 2
|
||||
property real spacingXS: 4
|
||||
@@ -1327,15 +1292,12 @@ Singleton {
|
||||
currentThemeCategory = "generic";
|
||||
}
|
||||
}
|
||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode);
|
||||
if (savePrefs && typeof SettingsData !== "undefined" && !isGreeterMode) {
|
||||
if (savePrefs && typeof SettingsData !== "undefined") {
|
||||
SettingsData.set("currentThemeCategory", currentThemeCategory);
|
||||
SettingsData.set("currentThemeName", currentTheme);
|
||||
}
|
||||
|
||||
if (!isGreeterMode) {
|
||||
generateSystemThemesFromCurrentTheme();
|
||||
}
|
||||
generateSystemThemesFromCurrentTheme();
|
||||
}
|
||||
|
||||
function setLightMode(light, savePrefs = true, enableTransition = false) {
|
||||
@@ -1347,18 +1309,15 @@ Singleton {
|
||||
return;
|
||||
}
|
||||
|
||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode);
|
||||
if (savePrefs && typeof SessionData !== "undefined" && !isGreeterMode) {
|
||||
if (savePrefs && typeof SessionData !== "undefined") {
|
||||
SessionData.setLightMode(light);
|
||||
}
|
||||
|
||||
if (!isGreeterMode) {
|
||||
PortalService.setLightMode(light);
|
||||
if (typeof SettingsData !== "undefined") {
|
||||
SettingsData.updateCosmicThemeMode(light);
|
||||
}
|
||||
generateSystemThemesFromCurrentTheme();
|
||||
PortalService.setLightMode(light);
|
||||
if (typeof SettingsData !== "undefined") {
|
||||
SettingsData.updateCosmicThemeMode(light);
|
||||
}
|
||||
generateSystemThemesFromCurrentTheme();
|
||||
}
|
||||
|
||||
function toggleLightMode(savePrefs = true) {
|
||||
@@ -1412,8 +1371,7 @@ Singleton {
|
||||
if (themeData.variants.type === "multi" && themeData.variants.flavors && themeData.variants.accents) {
|
||||
const defaults = themeData.variants.defaults || {};
|
||||
const modeDefaults = defaults[colorMode] || defaults.dark || {};
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const stored = isGreeterMode ? (GreetdSettings.registryThemeVariants[themeId]?.[colorMode] || modeDefaults) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, modeDefaults, colorMode) : modeDefaults);
|
||||
const stored = typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, modeDefaults, colorMode) : modeDefaults;
|
||||
var flavorId = stored.flavor || modeDefaults.flavor || "";
|
||||
const accentId = stored.accent || modeDefaults.accent || "";
|
||||
var flavor = findVariant(themeData.variants.flavors, flavorId);
|
||||
@@ -1439,8 +1397,7 @@ Singleton {
|
||||
}
|
||||
|
||||
if (themeData.variants.options && themeData.variants.options.length > 0) {
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const selectedVariantId = isGreeterMode ? (typeof GreetdSettings.registryThemeVariants[themeId] === "string" ? GreetdSettings.registryThemeVariants[themeId] : themeData.variants.default) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, themeData.variants.default) : themeData.variants.default);
|
||||
const selectedVariantId = typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, themeData.variants.default) : themeData.variants.default;
|
||||
const variant = findVariant(themeData.variants.options, selectedVariantId);
|
||||
if (variant) {
|
||||
const variantColors = variant[colorMode] || variant.dark || variant.light || {};
|
||||
@@ -1800,8 +1757,7 @@ Singleton {
|
||||
}
|
||||
|
||||
function generateSystemThemesFromCurrentTheme() {
|
||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode);
|
||||
if (!matugenAvailable || isGreeterMode)
|
||||
if (!matugenAvailable)
|
||||
return;
|
||||
|
||||
_lastGenerateMs = Date.now();
|
||||
@@ -1842,9 +1798,8 @@ Singleton {
|
||||
const defaults = customThemeRawData.variants.defaults || {};
|
||||
const darkDefaults = defaults.dark || {};
|
||||
const lightDefaults = defaults.light || defaults.dark || {};
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const storedDark = isGreeterMode ? (GreetdSettings.registryThemeVariants[themeId]?.dark || darkDefaults) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, darkDefaults, "dark") : darkDefaults);
|
||||
const storedLight = isGreeterMode ? (GreetdSettings.registryThemeVariants[themeId]?.light || lightDefaults) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, lightDefaults, "light") : lightDefaults);
|
||||
const storedDark = typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, darkDefaults, "dark") : darkDefaults;
|
||||
const storedLight = typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, lightDefaults, "light") : lightDefaults;
|
||||
const darkFlavorId = storedDark.flavor || darkDefaults.flavor || "";
|
||||
const lightFlavorId = storedLight.flavor || lightDefaults.flavor || "";
|
||||
const darkAccentId = storedDark.accent || darkDefaults.accent || "";
|
||||
@@ -1864,8 +1819,7 @@ Singleton {
|
||||
lightTheme = mergeColors(lightTheme, lightAccent[lightFlavor.id] || {});
|
||||
}
|
||||
} else if (customThemeRawData.variants.options) {
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const selectedVariantId = isGreeterMode ? (typeof GreetdSettings.registryThemeVariants[themeId] === "string" ? GreetdSettings.registryThemeVariants[themeId] : customThemeRawData.variants.default) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, customThemeRawData.variants.default) : customThemeRawData.variants.default);
|
||||
const selectedVariantId = typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, customThemeRawData.variants.default) : customThemeRawData.variants.default;
|
||||
const variant = findVariant(customThemeRawData.variants.options, selectedVariantId);
|
||||
if (variant) {
|
||||
darkTheme = mergeColors(darkTheme, variant.dark || {});
|
||||
@@ -2214,32 +2168,11 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string _greeterCacheDir: Quickshell.env("DMS_GREET_CFG_DIR") || "/var/cache/dms-greeter"
|
||||
|
||||
property string greeterColorsBaseDir: root._greeterCacheDir
|
||||
|
||||
function setGreeterColorsBaseDir(dir) {
|
||||
const next = dir || root._greeterCacheDir;
|
||||
if (greeterColorsBaseDir === next)
|
||||
return;
|
||||
greeterColorsBaseDir = next;
|
||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
|
||||
dynamicColorsFileView.reload();
|
||||
}
|
||||
|
||||
function resetGreeterColorsBaseDir() {
|
||||
setGreeterColorsBaseDir(root._greeterCacheDir);
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: dynamicColorsFileView
|
||||
path: {
|
||||
if (SessionData.isGreeterMode)
|
||||
return root.greeterColorsBaseDir ? (root.greeterColorsBaseDir + "/colors.json") : "";
|
||||
return stateDir + "/dms-colors.json";
|
||||
}
|
||||
path: stateDir + "/dms-colors.json"
|
||||
blockLoading: false
|
||||
watchChanges: !SessionData.isGreeterMode
|
||||
watchChanges: true
|
||||
|
||||
function parseAndLoadColors() {
|
||||
try {
|
||||
@@ -2274,9 +2207,6 @@ Singleton {
|
||||
if (currentTheme !== dynamic)
|
||||
return;
|
||||
|
||||
if (SessionData.isGreeterMode)
|
||||
return;
|
||||
|
||||
if (workerRunning) {
|
||||
colorsReloadRetry.restart();
|
||||
return;
|
||||
|
||||
@@ -13,14 +13,14 @@ Singleton {
|
||||
property var settingsRoot: null
|
||||
|
||||
onSettingsRootChanged: {
|
||||
if (settingsRoot && !settingsRoot.isGreeterMode)
|
||||
if (settingsRoot)
|
||||
consumeGreeterAutoLoginPendingSync();
|
||||
}
|
||||
|
||||
readonly property string greeterAutoLoginPendingSyncPath: (Quickshell.env("DMS_GREET_CFG_DIR") || "/var/cache/dms-greeter") + "/.local/state/auto-login-sync-pending"
|
||||
|
||||
function consumeGreeterAutoLoginPendingSync() {
|
||||
if (!settingsRoot || settingsRoot.isGreeterMode)
|
||||
if (!settingsRoot)
|
||||
return;
|
||||
greeterAutoLoginPendingCheckProcess.running = true;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ Singleton {
|
||||
property string authApplyTerminalFallbackStderr: ""
|
||||
|
||||
function scheduleAuthApply() {
|
||||
if (!settingsRoot || settingsRoot.isGreeterMode)
|
||||
if (!settingsRoot)
|
||||
return;
|
||||
|
||||
authApplyQueued = true;
|
||||
@@ -300,7 +300,7 @@ Singleton {
|
||||
}
|
||||
|
||||
function beginAuthApply() {
|
||||
if (!authApplyQueued || authApplyRunning || !settingsRoot || settingsRoot.isGreeterMode)
|
||||
if (!authApplyQueued || authApplyRunning || !settingsRoot)
|
||||
return;
|
||||
|
||||
authApplyQueued = false;
|
||||
@@ -339,7 +339,7 @@ Singleton {
|
||||
property string greeterAutoLoginSyncStderr: ""
|
||||
|
||||
function scheduleGreeterAutoLoginSync() {
|
||||
if (!settingsRoot || settingsRoot.isGreeterMode)
|
||||
if (!settingsRoot)
|
||||
return;
|
||||
|
||||
greeterAutoLoginSyncQueued = true;
|
||||
@@ -352,7 +352,7 @@ Singleton {
|
||||
}
|
||||
|
||||
function beginGreeterAutoLoginSync() {
|
||||
if (!greeterAutoLoginSyncQueued || greeterAutoLoginSyncRunning || !settingsRoot || settingsRoot.isGreeterMode)
|
||||
if (!greeterAutoLoginSyncQueued || greeterAutoLoginSyncRunning || !settingsRoot)
|
||||
return;
|
||||
|
||||
greeterAutoLoginSyncQueued = false;
|
||||
|
||||
Reference in New Issue
Block a user