core: add a few festive splashes

adds two new 'special' splash types for xmas and new years. Activated based on local time.
This commit is contained in:
Vaxry 2024-12-05 01:59:29 +00:00
parent f9e4998a6d
commit 22f7d6f142
2 changed files with 120 additions and 78 deletions

View file

@ -206,11 +206,21 @@ CCompositor::~CCompositor() {
} }
void CCompositor::setRandomSplash() { 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::random_device dev;
std::mt19937 engine(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; static std::vector<SP<Aquamarine::IOutput>> pendingOutputs;

View file

@ -3,80 +3,112 @@
#include <vector> #include <vector>
#include <string> #include <string>
inline const std::vector<std::string> SPLASHES = { namespace NSplashes {
// clang-format off inline const std::vector<std::string> SPLASHES = {
"Woo, animations!", // clang-format off
"It's like Hypr, but better.", "Woo, animations!",
"Release 1.0 when?", "It's like Hypr, but better.",
"It's not awesome, it's Hyprland!", "Release 1.0 when?",
"\"I commit too often, people can't catch up lmao\" - Vaxry", "It's not awesome, it's Hyprland!",
"This text is random.", "\"I commit too often, people can't catch up lmao\" - Vaxry",
"\"There are reasons to not use rust.\" - Boga", "This text is random.",
"Read the wiki.", "\"There are reasons to not use rust.\" - Boga",
"\"Hello everyone this is YOUR daily dose of read the wiki\" - Vaxry", "Read the wiki.",
"h", "\"Hello everyone this is YOUR daily dose of read the wiki\" - Vaxry",
"\"why no work, bro I haven't hacked your pc to get live feeds yet\" - Vaxry", "h",
"Compile, wait for 20 minutes, notice a new commit, compile again.", "\"why no work, bro I haven't hacked your pc to get live feeds yet\" - Vaxry",
"To rice, or not to rice, that is the question.", "Compile, wait for 20 minutes, notice a new commit, compile again.",
"Now available on Fedora!", "To rice, or not to rice, that is the question.",
"\"Hyprland is so good it starts with a capital letter\" - Hazel", "Now available on Fedora!",
"\"please make this message a splash\" - eriedaberrie", "\"Hyprland is so good it starts with a capital letter\" - Hazel",
"\"the only wayland compositor powered by fried chicken\" - raf", "\"please make this message a splash\" - eriedaberrie",
"\"This will never get into Hyprland\" - Flafy", "\"the only wayland compositor powered by fried chicken\" - raf",
"\"Hyprland only gives you up on -git\" - fazzi", "\"This will never get into Hyprland\" - Flafy",
"Segmentation fault (core dumped)", "\"Hyprland only gives you up on -git\" - fazzi",
"\"disabling hyprland logo is a war crime\" - vaxry", "Segmentation fault (core dumped)",
"some basic startup code", "\"disabling hyprland logo is a war crime\" - vaxry",
"\"I think I am addicted to hyprland\" - mathisbuilder", "some basic startup code",
"\"hyprland is the most important package in the arch repos\" - jacekpoz", "\"I think I am addicted to hyprland\" - mathisbuilder",
"Thanks Brodie!", "\"hyprland is the most important package in the arch repos\" - jacekpoz",
"Thanks fufexan!", "Thanks Brodie!",
"Thanks raf!", "Thanks fufexan!",
"You can't use --splash to change this message :)", "Thanks raf!",
"Hyprland will overtake Gnome in popularity by [insert year]", "You can't use --splash to change this message :)",
// music reference / quote section "Hyprland will overtake Gnome in popularity by [insert year]",
"J'remue le ciel, le jour, la nuit.", // music reference / quote section
"aezakmi, aezakmi, aezakmi, aezakmi, aezakmi, aezakmi, aezakmi!", "J'remue le ciel, le jour, la nuit.",
"Wir sind schon sehr lang zusammen...", "aezakmi, aezakmi, aezakmi, aezakmi, aezakmi, aezakmi, aezakmi!",
"I see a red door and I want it painted black.", "Wir sind schon sehr lang zusammen...",
"Take on me, take me on...", "I see a red door and I want it painted black.",
"You spin me right round baby right round", "Take on me, take me on...",
"Stayin' alive, stayin' alive", "You spin me right round baby right round",
"Say no way, say no way ya, no way!", "Stayin' alive, stayin' alive",
"Ground control to Major Tom...", "Say no way, say no way ya, no way!",
"Alors on danse", "Ground control to Major Tom...",
"And all that I can see, is just a yellow lemon tree.", "Alors on danse",
"Got a one-way ticket to the blues", "And all that I can see, is just a yellow lemon tree.",
"Is this the real life, is this just fantasy", "Got a one-way ticket to the blues",
"What's in your head, in your head?", "Is this the real life, is this just fantasy",
"We're all living in America, America, America.", "What's in your head, in your head?",
"I'm still standing, better than I ever did", "We're all living in America, America, America.",
"Here comes the sun, bringing you love and shining on everyone", "I'm still standing, better than I ever did",
"Two trailer park girls go round the outside", "Here comes the sun, bringing you love and shining on everyone",
"With the lights out, it's less dangerous", "Two trailer park girls go round the outside",
"Here we go back, this is the moment, tonight is the night", "With the lights out, it's less dangerous",
"Now you're just somebody that I used to know...", "Here we go back, this is the moment, tonight is the night",
"Black bird, black moon, black sky", "Now you're just somebody that I used to know...",
"Some legends are told, some turn to dust or to gold", "Black bird, black moon, black sky",
"Your brain gets smart, but your head gets dumb.", "Some legends are told, some turn to dust or to gold",
"Save your mercy for someone who needs it more", "Your brain gets smart, but your head gets dumb.",
"You're gonna hear my voice when I shout it out loud", "Save your mercy for someone who needs it more",
"Ding ding pch n daa, bam-ba-ba-re-bam baram bom bom baba-bam-bam-bommm", "You're gonna hear my voice when I shout it out loud",
"Súbeme la radio que esta es mi canción", "Ding ding pch n daa, bam-ba-ba-re-bam baram bom bom baba-bam-bam-bommm",
"I'm beggin', beggin' you", "Súbeme la radio que esta es mi canción",
"Never gonna let you down (I am trying!)", "I'm beggin', beggin' you",
"\"I use Arch, btw\" - John Cena", "Never gonna let you down (I am trying!)",
"\"Hyper\".replace(\"e\", \"\")", "\"I use Arch, btw\" - John Cena",
"\"my win11 install runs hyprland that is true\" - raf", "\"Hyper\".replace(\"e\", \"\")",
"\"stop playing league loser\" - hyprBot", "\"my win11 install runs hyprland that is true\" - raf",
"\"If it ain't broke, don't fix it\" - Lucascito_03", "\"stop playing league loser\" - hyprBot",
"\"@vaxry how do i learn c++\" - flicko", "\"If it ain't broke, don't fix it\" - Lucascito_03",
// "\"@vaxry how do i learn c++\" - flicko",
"Join the discord server!", //
"Thanks ThatOneCalculator!", "Join the discord server!",
"The AUR packages always work, except for the times they don't.", "Thanks ThatOneCalculator!",
"Funny animation compositor woo", "The AUR packages always work, except for the times they don't.",
// "Funny animation compositor woo",
"2 years!" //
// clang-format on "2 years!"
// clang-format on
};
inline const std::vector<std::string> SPLASHES_CHRISTMAS = {
// clang-format off
"Merry Christmas!",
"Merry Xmas!",
"Ho ho ho",
"Santa was here",
// clang-format on
};
// ONLY valid near new years.
inline static int newYear = []() -> int {
auto tt = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
auto local = *localtime(&tt);
if (local.tm_mon < 8 /* decided with a fair die I promise. */)
return local.tm_year + 1900;
return local.tm_year + 1901;
}();
inline const std::vector<std::string> SPLASHES_NEWYEAR = {
// clang-format off
"Happy new Year!",
"[New year] will be the year of the Linux desktop!",
"[New year] will be the year of the Hyprland desktop!",
std::format("{} will be the year of the Linux desktop!", newYear),
std::format("{} will be the year of the Hyprland desktop!", newYear),
std::format("Let's make {} even better than {}!", newYear, newYear - 1),
// clang-format on
};
}; };