mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-03 19:01:50 +00:00
Merge pull request #394 from ixxie/feat/temp-settings
[NixOS] feat/temp settings
This commit is contained in:
+22
-2
@@ -71,7 +71,13 @@ Singleton {
|
||||
id: saveTimer
|
||||
running: false
|
||||
interval: 1000
|
||||
onTriggered: settingsFileView.writeAdapter()
|
||||
onTriggered: {
|
||||
settingsFileView.writeAdapter()
|
||||
// Write to fallback location if set
|
||||
if (Quickshell.env("NOCTALIA_SETTINGS_FALLBACK")) {
|
||||
settingsFallbackFileView.writeAdapter()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileView {
|
||||
@@ -101,11 +107,25 @@ Singleton {
|
||||
}
|
||||
}
|
||||
onLoadFailed: function (error) {
|
||||
if (error.toString().includes("No such file") || error === 2)
|
||||
if (error.toString().includes("No such file") || error === 2) {
|
||||
// File doesn't exist, create it with default values
|
||||
writeAdapter()
|
||||
// Also write to fallback if set
|
||||
if (Quickshell.env("NOCTALIA_SETTINGS_FALLBACK")) {
|
||||
settingsFallbackFileView.writeAdapter()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback FileView for writing settings to alternate location
|
||||
FileView {
|
||||
id: settingsFallbackFileView
|
||||
path: Quickshell.env("NOCTALIA_SETTINGS_FALLBACK") || ""
|
||||
adapter: Quickshell.env("NOCTALIA_SETTINGS_FALLBACK") ? adapter : null
|
||||
printErrors: false
|
||||
watchChanges: false
|
||||
}
|
||||
JsonAdapter {
|
||||
id: adapter
|
||||
|
||||
|
||||
@@ -264,6 +264,7 @@
|
||||
after = [ cfg.target ];
|
||||
partOf = [ cfg.target ];
|
||||
wantedBy = [ cfg.target ];
|
||||
restartTriggers = [ cfg.package ];
|
||||
|
||||
unitConfig = {
|
||||
StartLimitIntervalSec = 60;
|
||||
@@ -276,7 +277,10 @@
|
||||
RestartSec = 3;
|
||||
TimeoutStartSec = 10;
|
||||
TimeoutStopSec = 5;
|
||||
Environment = [ "PATH=${config.system.path}/bin" ];
|
||||
Environment = [
|
||||
"PATH=${config.system.path}/bin"
|
||||
"NOCTALIA_SETTINGS_FALLBACK=%h/.config/noctalia/gui-settings.json"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user