mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-06 12:02:24 +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
|
id: saveTimer
|
||||||
running: false
|
running: false
|
||||||
interval: 1000
|
interval: 1000
|
||||||
onTriggered: settingsFileView.writeAdapter()
|
onTriggered: {
|
||||||
|
settingsFileView.writeAdapter()
|
||||||
|
// Write to fallback location if set
|
||||||
|
if (Quickshell.env("NOCTALIA_SETTINGS_FALLBACK")) {
|
||||||
|
settingsFallbackFileView.writeAdapter()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
@@ -101,11 +107,25 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onLoadFailed: function (error) {
|
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
|
// File doesn't exist, create it with default values
|
||||||
writeAdapter()
|
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 {
|
JsonAdapter {
|
||||||
id: adapter
|
id: adapter
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,7 @@
|
|||||||
after = [ cfg.target ];
|
after = [ cfg.target ];
|
||||||
partOf = [ cfg.target ];
|
partOf = [ cfg.target ];
|
||||||
wantedBy = [ cfg.target ];
|
wantedBy = [ cfg.target ];
|
||||||
|
restartTriggers = [ cfg.package ];
|
||||||
|
|
||||||
unitConfig = {
|
unitConfig = {
|
||||||
StartLimitIntervalSec = 60;
|
StartLimitIntervalSec = 60;
|
||||||
@@ -276,7 +277,10 @@
|
|||||||
RestartSec = 3;
|
RestartSec = 3;
|
||||||
TimeoutStartSec = 10;
|
TimeoutStartSec = 10;
|
||||||
TimeoutStopSec = 5;
|
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