summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-12-02 22:26:43 +0000
committerGitHub <noreply@github.com>2025-12-02 22:26:43 +0000
commit2cadc8ababb56331c110b7584e09fe0f9352672d (patch)
tree397abc2e82d498f63dd3efd9ae5c651438398c5e /src/managers
parentf82a8630d7a51dab4cc70924f500bf70e723db12 (diff)
welcome: init welcome manager (#12409)
--------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/WelcomeManager.cpp31
-rw-r--r--src/managers/WelcomeManager.hpp16
2 files changed, 47 insertions, 0 deletions
diff --git a/src/managers/WelcomeManager.cpp b/src/managers/WelcomeManager.cpp
new file mode 100644
index 00000000..fdbbadfe
--- /dev/null
+++ b/src/managers/WelcomeManager.cpp
@@ -0,0 +1,31 @@
+#include "WelcomeManager.hpp"
+#include "../debug/Log.hpp"
+#include "../config/ConfigValue.hpp"
+#include "../helpers/fs/FsUtils.hpp"
+
+#include <hyprutils/os/Process.hpp>
+
+using namespace Hyprutils::OS;
+
+CWelcomeManager::CWelcomeManager() {
+ static auto PAUTOGEN = CConfigValue<Hyprlang::INT>("autogenerated");
+
+ if (!*PAUTOGEN) {
+ Debug::log(LOG, "[welcome] skipping, not autogen");
+ return;
+ }
+
+ if (!NFsUtils::executableExistsInPath("hyprland-welcome")) {
+ Debug::log(LOG, "[welcome] skipping, no welcome app");
+ return;
+ }
+
+ m_fired = true;
+
+ CProcess welcome("hyprland-welcome", {});
+ welcome.runAsync();
+}
+
+bool CWelcomeManager::fired() {
+ return m_fired;
+}
diff --git a/src/managers/WelcomeManager.hpp b/src/managers/WelcomeManager.hpp
new file mode 100644
index 00000000..1f0535eb
--- /dev/null
+++ b/src/managers/WelcomeManager.hpp
@@ -0,0 +1,16 @@
+#pragma once
+
+#include "../helpers/memory/Memory.hpp"
+
+class CWelcomeManager {
+ public:
+ CWelcomeManager();
+
+ // whether the welcome screen was shown this boot.
+ bool fired();
+
+ private:
+ bool m_fired = false;
+};
+
+inline UP<CWelcomeManager> g_pWelcomeManager; \ No newline at end of file