summaryrefslogtreecommitdiff
path: root/src/managers/WelcomeManager.cpp
blob: 7a0b8f7f6370657eec8e7824344dd8b52e253eb8 (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/Logger.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) {
        Log::logger->log(Log::DEBUG, "[welcome] skipping, not autogen");
        return;
    }

    if (!NFsUtils::executableExistsInPath("hyprland-welcome")) {
        Log::logger->log(Log::DEBUG, "[welcome] skipping, no welcome app");
        return;
    }

    m_fired = true;

    CProcess welcome("hyprland-welcome", {});
    welcome.runAsync();
}

bool CWelcomeManager::fired() {
    return m_fired;
}