diff options
author | Vaxry <[email protected]> | 2024-12-05 01:59:29 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-12-05 01:59:36 +0000 |
commit | 22f7d6f1424c296b297df87bf2accdfefac4af33 (patch) | |
tree | d5a7da8ecf39c1fd83a083fc7c8325b114d27bd3 /src/Compositor.cpp | |
parent | f9e4998a6d7713b19947b0db2c43ad88c5b71d80 (diff) | |
download | Hyprland-22f7d6f1424c296b297df87bf2accdfefac4af33.tar.gz Hyprland-22f7d6f1424c296b297df87bf2accdfefac4af33.zip |
core: add a few festive splashes
adds two new 'special' splash types for xmas and new years. Activated based on local time.
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r-- | src/Compositor.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 3573996d..1261d003 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -206,11 +206,21 @@ CCompositor::~CCompositor() { } void CCompositor::setRandomSplash() { + auto tt = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); + auto local = *localtime(&tt); + + const auto* SPLASHES = &NSplashes::SPLASHES; + + if (local.tm_mon + 1 == 12 && local.tm_mday >= 23 && local.tm_mday <= 27) // dec 23-27 + SPLASHES = &NSplashes::SPLASHES_CHRISTMAS; + if ((local.tm_mon + 1 == 12 && local.tm_mday >= 29) || (local.tm_mon + 1 == 1 && local.tm_mday <= 3)) + SPLASHES = &NSplashes::SPLASHES_NEWYEAR; + std::random_device dev; std::mt19937 engine(dev()); - std::uniform_int_distribution<> distribution(0, SPLASHES.size() - 1); + std::uniform_int_distribution<> distribution(0, SPLASHES->size() - 1); - m_szCurrentSplash = SPLASHES[distribution(engine)]; + m_szCurrentSplash = SPLASHES->at(distribution(engine)); } static std::vector<SP<Aquamarine::IOutput>> pendingOutputs; |