diff --git a/Colors.qml b/Colors.qml index f2d12b1..0aa2ace 100644 --- a/Colors.qml +++ b/Colors.qml @@ -10,7 +10,7 @@ Singleton { property alias c: colors FileView { id: colorView - path: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/" + Config.cfg.appearance.currentTheme + ".json") + path: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/" + Config.cfg.appearance.currentTheme) onFileChanged: { reload(); } diff --git a/modules/applets/ThemeSwitcher.qml b/modules/applets/ThemeSwitcher.qml index d378524..ee48c79 100644 --- a/modules/applets/ThemeSwitcher.qml +++ b/modules/applets/ThemeSwitcher.qml @@ -3,6 +3,7 @@ import Quickshell import Quickshell.Io import QtQuick import QtQuick.Layouts +import Qt.labs.folderlistmodel 2.11 import qs import qs.settings @@ -19,16 +20,9 @@ Rectangle { acceptedButtons: Qt.AllButtons anchors.fill: parent } - Process { - id: getSchemes - property list schemes - running: true - command: ["tinty", "list"] - stdout: SplitParser { - onRead: text => { - getSchemes.schemes.push(text); - } - } + FolderListModel { + id: schemeModel + folder: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/") } Rectangle { anchors.fill: parent @@ -45,11 +39,12 @@ Rectangle { id: schemeList spacing: 5 Layout.fillHeight: true - model: getSchemes.schemes + model: schemeModel implicitWidth: 300 delegate: Rectangle { id: container - required property string modelData + required property var modelData + color: Colors.c.base02 height: 30 radius: Config.cfg.appearance.rounding @@ -57,7 +52,7 @@ Rectangle { StyledText { id: schemeName anchors.centerIn: parent - text: container.modelData + text: container.modelData.fileName } MouseArea { id: schemeSetter @@ -65,9 +60,9 @@ Rectangle { acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor onClicked: { - setTheme.themeName = modelData; + setTheme.themeName = modelData.fileName; setTheme.running = true; - Config.cfg.appearance.currentTheme = modelData; + Config.cfg.appearance.currentTheme = modelData.fileName; } Process { id: setTheme diff --git a/settings/settings.json b/settings/settings.json index 9a00d7a..c476e72 100644 --- a/settings/settings.json +++ b/settings/settings.json @@ -1,6 +1,6 @@ { "appearance": { - "currentTheme": "base16-github-dark", + "currentTheme": "base16-catppuccin-mocha.json", "font": "Roboto Medium", "fontSize": 14, "iconSize": 14,