summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Services/ChangelogService.qml
diff options
context:
space:
mode:
authorAlexanderCurl <alexc@alexc.hu>2026-04-18 17:46:06 +0100
committerAlexanderCurl <alexc@alexc.hu>2026-04-18 17:46:06 +0100
commit70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69 (patch)
treeab1123d4067c1b086dd6faa7ee4ea643236b565a /raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Services/ChangelogService.qml
parent5d94c0a7d44a2255b81815a52a7056a94a39842d (diff)
downloadRaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.tar.gz
RaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.zip
Replaced file structures for themes in the correct format
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Services/ChangelogService.qml')
-rw-r--r--raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Services/ChangelogService.qml108
1 files changed, 108 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Services/ChangelogService.qml b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Services/ChangelogService.qml
new file mode 100644
index 0000000..562a513
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Services/ChangelogService.qml
@@ -0,0 +1,108 @@
+pragma Singleton
+pragma ComponentBehavior: Bound
+
+import QtCore
+import QtQuick
+import Quickshell
+import Quickshell.Io
+import qs.Common
+
+Singleton {
+ id: root
+
+ readonly property string currentVersion: "1.4"
+ readonly property bool changelogEnabled: false
+
+ readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation)) + "/DankMaterialShell"
+ readonly property string changelogMarkerPath: configDir + "/.changelog-" + currentVersion
+
+ property bool checkComplete: false
+ property bool changelogDismissed: false
+
+ readonly property bool shouldShowChangelog: {
+ if (!checkComplete)
+ return false;
+ if (!changelogEnabled)
+ return false;
+ if (changelogDismissed)
+ return false;
+ if (typeof FirstLaunchService !== "undefined" && FirstLaunchService.isFirstLaunch)
+ return false;
+ return true;
+ }
+
+ signal changelogRequested
+ signal changelogCompleted
+
+ Component.onCompleted: {
+ if (!changelogEnabled)
+ return;
+ if (FirstLaunchService.checkComplete)
+ handleFirstLaunchResult();
+ }
+
+ function handleFirstLaunchResult() {
+ if (FirstLaunchService.isFirstLaunch) {
+ checkComplete = true;
+ changelogDismissed = true;
+ touchMarkerProcess.running = true;
+ } else {
+ changelogCheckProcess.running = true;
+ }
+ }
+
+ Connections {
+ target: FirstLaunchService
+
+ function onCheckCompleteChanged() {
+ if (FirstLaunchService.checkComplete && root.changelogEnabled && !root.checkComplete)
+ root.handleFirstLaunchResult();
+ }
+ }
+
+ function showChangelog() {
+ changelogRequested();
+ }
+
+ function dismissChangelog() {
+ changelogDismissed = true;
+ touchMarkerProcess.running = true;
+ changelogCompleted();
+ }
+
+ Process {
+ id: changelogCheckProcess
+
+ command: ["sh", "-c", "[ -f '" + changelogMarkerPath + "' ] && echo 'seen' || echo 'show'"]
+ running: false
+
+ stdout: SplitParser {
+ onRead: data => {
+ const result = data.trim();
+ root.checkComplete = true;
+
+ switch (result) {
+ case "seen":
+ root.changelogDismissed = true;
+ break;
+ case "show":
+ root.changelogRequested();
+ break;
+ }
+ }
+ }
+ }
+
+ Process {
+ id: touchMarkerProcess
+
+ command: ["sh", "-c", "mkdir -p '" + configDir + "' && touch '" + changelogMarkerPath + "'"]
+ running: false
+
+ onExited: exitCode => {
+ if (exitCode !== 0) {
+ console.warn("ChangelogService: Failed to create changelog marker");
+ }
+ }
+ }
+}