pragma Singleton import QtQuick import Quickshell import Quickshell.Io import qs.Services Singleton { property string shellName: "Noctalia" property string settingsDir: Quickshell.env("HOME") + "/.config/" + shellName + "/" property string settingsFile: settingsDir + "Settings.json" property var settings: settingAdapter Item { Component.onCompleted: { // ensure settings dir Quickshell.execDetached(["mkdir", "-p", settingsDir]); } } FileView { id: settingFileView path: settingsFile watchChanges: true onFileChanged: reload() onAdapterUpdated: writeAdapter() Component.onCompleted: function() { reload() } onLoaded: function() { WallpaperManager.setCurrentWallpaper(settings.currentWallpaper, true); } onLoadFailed: function(error) { settingAdapter = {} writeAdapter() } JsonAdapter { id: settingAdapter property string weatherCity: "Dinslaken" property string profileImage: Quickshell.env("HOME") + "/.face" property bool useFahrenheit: false property string wallpaperFolder: "/usr/share/wallpapers" property string currentWallpaper: "" property string videoPath: "~/Videos/" property bool showActiveWindowIcon: false property bool showSystemInfoInBar: false property bool showMediaInBar: false property bool useSWWW: false property bool randomWallpaper: false property bool useWallpaperTheme: false property int wallpaperInterval: 300 property string wallpaperResize: "crop" property int transitionFps: 60 property string transitionType: "random" property real transitionDuration: 1.1 property string visualizerType: "radial" property bool reverseDayMonth: false property bool use12HourClock: false property bool dimPanels: true } } Connections { target: settingAdapter function onRandomWallpaperChanged() { WallpaperManager.toggleRandomWallpaper() } function onWallpaperIntervalChanged() { WallpaperManager.restartRandomWallpaperTimer() } function onWallpaperFolderChanged() { WallpaperManager.loadWallpapers() } } }