pragma Singleton import Quickshell import Quickshell.Io // Read-only user config for ebar. Reads ~/.config/ebar/config.json if it exists and // live-reloads on external edits. If the file is missing, the JsonAdapter defaults below // are used as-is. This singleton never writes to disk or creates directories. Singleton { id: config readonly property string configHome: { const x = Quickshell.env("XDG_CONFIG_HOME") return (x && x.length) ? x : Quickshell.env("HOME") + "/.config" } // Ordered widget lists per bar section. Names resolve via Bar.widgetFor(). property alias leftWidgets: adapter.leftWidgets property alias centerWidgets: adapter.centerWidgets property alias rightWidgets: adapter.rightWidgets property alias niriWindowThumbnails: adapter.niriWindowThumbnails FileView { id: file path: config.configHome + "/ebar/config.json" watchChanges: true onFileChanged: reload() JsonAdapter { id: adapter property var leftWidgets: ["media", "niriWindows"] property var niriWindowThumbnails: ({ enable: false, labels: false }) property var centerWidgets: [] property var rightWidgets: ["idleInhibit", "audio", "tray", "clock"] } } }