disable modules, README, warning fixes
This commit is contained in:
parent
ed68b9fd93
commit
5ad933c03b
9 changed files with 215 additions and 24 deletions
48
modules/Modules.qml
Normal file
48
modules/Modules.qml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
||||
property bool tray: true
|
||||
property bool windowTitle: true
|
||||
property bool clock: true
|
||||
property bool notifications: true
|
||||
property bool mpris: true
|
||||
property bool volume: true
|
||||
property bool bluetooth: true
|
||||
property bool backlight: true
|
||||
property bool network: true
|
||||
property bool powerProfile: true
|
||||
property bool idleInhibitor: true
|
||||
property bool weather: true
|
||||
property bool temperature: true
|
||||
property bool cpu: true
|
||||
property bool memory: true
|
||||
property bool disk: true
|
||||
property bool battery: true
|
||||
property bool wlogout: true
|
||||
|
||||
property FileView _file: FileView {
|
||||
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/modules.json"
|
||||
watchChanges: true
|
||||
onFileChanged: reload()
|
||||
onLoaded: root._apply(text())
|
||||
}
|
||||
|
||||
function _apply(raw) {
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(raw);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
for (const k of Object.keys(data)) {
|
||||
if (k in root && typeof root[k] === "boolean")
|
||||
root[k] = data[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue