summaryrefslogtreecommitdiff
path: root/src/managers/WelcomeManager.cpp
blob: fdbbadfeeaa633e0a231336cfb3b4a5c5cfd9ecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
}