diff --git a/Makefile b/Makefile index 380d5b0a..ff383ef7 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,9 @@ install: cp ./assets/wall_2K.png ${PREFIX}/share/hyprland cp ./assets/wall_4K.png ${PREFIX}/share/hyprland cp ./assets/wall_8K.png ${PREFIX}/share/hyprland + cp ./assets/wall_anime_2K.png ${PREFIX}/share/hyprland + cp ./assets/wall_anime_4K.png ${PREFIX}/share/hyprland + cp ./assets/wall_anime_8K.png ${PREFIX}/share/hyprland mkdir -p ${PREFIX}/share/man/man1 install -m644 ./docs/*.1 ${PREFIX}/share/man/man1 diff --git a/assets/wall_anime_2K.png b/assets/wall_anime_2K.png new file mode 100644 index 00000000..202dc493 Binary files /dev/null and b/assets/wall_anime_2K.png differ diff --git a/assets/wall_anime_4K.png b/assets/wall_anime_4K.png new file mode 100644 index 00000000..687b79c3 Binary files /dev/null and b/assets/wall_anime_4K.png differ diff --git a/assets/wall_anime_8K.png b/assets/wall_anime_8K.png new file mode 100644 index 00000000..25c15cd7 Binary files /dev/null and b/assets/wall_anime_8K.png differ diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 9810a6fb..b3688a17 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -3,6 +3,7 @@ #include "../Compositor.hpp" #include "../helpers/MiscFunctions.hpp" #include "Shaders.hpp" +#include CHyprOpenGLImpl::CHyprOpenGLImpl() { RASSERT(eglMakeCurrent(wlr_egl_get_display(g_pCompositor->m_sWLREGL), EGL_NO_SURFACE, EGL_NO_SURFACE, wlr_egl_get_context(g_pCompositor->m_sWLREGL)), @@ -1547,7 +1548,13 @@ void CHyprOpenGLImpl::renderSplash(cairo_t* const CAIRO, cairo_surface_t* const void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) { RASSERT(m_RenderData.pMonitor, "Tried to createBGTex without begin()!"); - static auto* const PNOSPLASH = &g_pConfigManager->getConfigValuePtr("misc:disable_splash_rendering")->intValue; + static auto* const PNOSPLASH = &g_pConfigManager->getConfigValuePtr("misc:disable_splash_rendering")->intValue; + + std::random_device dev; + std::mt19937 engine(dev()); + std::uniform_int_distribution<> distribution(0, 10); + + const bool USEANIME = distribution(engine) % 2 == 0; // about 50% I think // release the last tex if exists const auto PTEX = &m_mMonitorBGTextures[pMonitor]; @@ -1560,13 +1567,11 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) { // TODO: use relative paths to the installation // or configure the paths at build time - // check if wallpapers exist - if (!std::filesystem::exists("/usr/share/hyprland/wall_8K.png")) - return; // the texture will be empty, oh well. We'll clear with a solid color anyways. - // get the adequate tex - std::string texPath = "/usr/share/hyprland/wall_"; - Vector2D textureSize; + std::string texPath = "/usr/share/hyprland/wall_" + std::string(USEANIME ? "anime_" : ""); + // check if wallpapers exist + + Vector2D textureSize; if (pMonitor->vecTransformedSize.x > 3850) { textureSize = Vector2D(7680, 4320); texPath += "8K.png"; @@ -1578,6 +1583,14 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) { texPath += "2K.png"; } + if (!std::filesystem::exists(texPath)) { + // try local + texPath = texPath.substr(0, 5) + "local/" + texPath.substr(5); + + if (!std::filesystem::exists(texPath)) + return; // the texture will be empty, oh well. We'll clear with a solid color anyways. + } + PTEX->m_vSize = textureSize; // calc the target box