welcome: init welcome manager (#12409)

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
This commit is contained in:
Vaxry 2025-12-02 22:26:43 +00:00 committed by GitHub
parent f82a8630d7
commit 2cadc8abab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 70 additions and 18 deletions

36
flake.lock generated
View file

@ -16,11 +16,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763922789, "lastModified": 1764370710,
"narHash": "sha256-XnkWjCpeXfip9tqYdL0b0zzBDjq+dgdISvEdSVGdVyA=", "narHash": "sha256-7iZklFmziy6Vn5ZFy9mvTSuFopp3kJNuPxL5QAvtmFQ=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "a20a0e67a33b6848378a91b871b89588d3a12573", "rev": "561ae7fbe1ca15dfd908262ec815bf21a13eef63",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -144,11 +144,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763727565, "lastModified": 1764616927,
"narHash": "sha256-vRff/2R1U1jzPBy4OODqh2kfUzmizW/nfV2ROzTDIKo=", "narHash": "sha256-wRT0MKkpPo11ijSX3KeMN+EQWnpSeUlRtyF3pFLtlRU=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-guiutils", "repo": "hyprland-guiutils",
"rev": "7724d3a12a0453e7aae05f2ef39474219f05a4b4", "rev": "25cedbfdc5b3ea391d8307c9a5bea315e5df3c52",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -193,11 +193,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763819661, "lastModified": 1764612430,
"narHash": "sha256-0jLarTR/BLWdGlboM86bPVP2zKJNI2jvo3JietnDkOM=", "narHash": "sha256-54ltTSbI6W+qYGMchAgCR6QnC1kOdKXN6X6pJhOWxFg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlang", "repo": "hyprlang",
"rev": "a318deec0c12409ec39c68d2be8096b636dc2a5c", "rev": "0d00dc118981531aa731150b6ea551ef037acddd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -238,11 +238,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763503177, "lastModified": 1764592794,
"narHash": "sha256-VPoiswJBBmTLVuNncvT/8FpFR+sYcAi/LgP/zTZ+5rA=", "narHash": "sha256-7CcO+wbTJ1L1NBQHierHzheQGPWwkIQug/w+fhTAVuU=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprtoolkit", "repo": "hyprtoolkit",
"rev": "f4e1e12755567ecf39090203b8f43eace8279630", "rev": "5cfe0743f0e608e1462972303778d8a0859ee63e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -261,11 +261,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763996058, "lastModified": 1764637132,
"narHash": "sha256-DsqzFZvrEV+aDmavjaD4/bk5qxeZwhGxPWBQdpFyM9Y=", "narHash": "sha256-vSyiKCzSY48kA3v39GFu6qgRfigjKCU/9k1KTK475gg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "0168583075baffa083032ed13a8bea8ea12f281a", "rev": "2f2413801beee37303913fc3c964bbe92252a963",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -299,11 +299,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1763966396, "lastModified": 1764517877,
"narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -60,6 +60,7 @@
#include "managers/HookSystemManager.hpp" #include "managers/HookSystemManager.hpp"
#include "managers/ProtocolManager.hpp" #include "managers/ProtocolManager.hpp"
#include "managers/LayoutManager.hpp" #include "managers/LayoutManager.hpp"
#include "managers/WelcomeManager.hpp"
#include "render/AsyncResourceGatherer.hpp" #include "render/AsyncResourceGatherer.hpp"
#include "plugins/PluginSystem.hpp" #include "plugins/PluginSystem.hpp"
#include "hyprerror/HyprError.hpp" #include "hyprerror/HyprError.hpp"
@ -603,6 +604,7 @@ void CCompositor::cleanup() {
g_pEventLoopManager.reset(); g_pEventLoopManager.reset();
g_pVersionKeeperMgr.reset(); g_pVersionKeeperMgr.reset();
g_pDonationNagManager.reset(); g_pDonationNagManager.reset();
g_pWelcomeManager.reset();
g_pANRManager.reset(); g_pANRManager.reset();
g_pConfigWatcher.reset(); g_pConfigWatcher.reset();
g_pAsyncResourceGatherer.reset(); g_pAsyncResourceGatherer.reset();
@ -708,6 +710,9 @@ void CCompositor::initManagers(eManagersInitStage stage) {
Debug::log(LOG, "Creating the DonationNag!"); Debug::log(LOG, "Creating the DonationNag!");
g_pDonationNagManager = makeUnique<CDonationNagManager>(); g_pDonationNagManager = makeUnique<CDonationNagManager>();
Debug::log(LOG, "Creating the WelcomeManager!");
g_pWelcomeManager = makeUnique<CWelcomeManager>();
Debug::log(LOG, "Creating the ANRManager!"); Debug::log(LOG, "Creating the ANRManager!");
g_pANRManager = makeUnique<CANRManager>(); g_pANRManager = makeUnique<CANRManager>();

View file

@ -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;
}

View file

@ -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;