From 0aa926c4a1a508913bf69f2b99e25286818fbdf1 Mon Sep 17 00:00:00 2001 From: DepressedTWM Date: Fri, 1 May 2026 11:51:39 -0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B1=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D0=B1=D0=B8=D0=BD=D0=B4=D0=B8?= =?UTF-8?q?=D0=BD=D0=B3=D0=B0=20=D0=BE=D0=B1=D0=BE=D0=B5=D0=B2=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D0=BA=D0=BE=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D0=B4=D0=B6=D0=B5=D1=80=D0=B0=D1=85=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=20Linux,=20=D0=BF=D0=BE=D0=BA=D0=B0=20=D1=82=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B6=D0=BA=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20?= =?UTF-8?q?=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20feh=20=D0=B8=20=D1=80=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=BE=D1=80=D0=B0=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7?= =?UTF-8?q?=20nitrogen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- binding-mri/wallpaper-binding.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/binding-mri/wallpaper-binding.cpp b/binding-mri/wallpaper-binding.cpp index 78ca5a4..a3b7c07 100644 --- a/binding-mri/wallpaper-binding.cpp +++ b/binding-mri/wallpaper-binding.cpp @@ -53,6 +53,9 @@ static std::map defBlurs; // Fallback settings static std::string fallbackPath; + //meow + bool IsNitrogen = false; + bool IsFeh = false; #endif #endif @@ -60,7 +63,21 @@ void desktopEnvironmentInit(){ printf("[desktopEnvironmentInit] desktopEnvironmentInit()\n"); if (desktop != "uninitialized") { - return; + printf("[desktopEnvironmentInit] Running on standalone Window Manager?Trying identify configuration...\n"); + // If Nitrogen wallpaper manager and feh is aviable we can just use nitrogen --restore command and feh --bg-scale:P + if (FILE *file = fopen("/usr/bin/nitrogen", "r")){ + IsNitrogen = true; + printf("[desktopEnvironmentInit] Nitrogen wallpaper manager detected!I will try to use it...\n"); + fclose(file); + }else{ fclose(file); } + if (FILE *file = fopen("/usr/bin/feh", "r")) { + IsFeh = true; + printf("[desktopEnvironmentInit] Feh detected!I will try to use it...\n"); + fclose(file); + } else{ fclose(file); } + if(!IsNitrogen && !IsFeh){ + return; + } } desktop = shState->oneshot().desktopEnv; if (desktop == "cinnamon" || desktop == "gnome" || desktop == "mate" || desktop == "deepin") { @@ -175,7 +192,7 @@ RB_METHOD(wallpaperSet){ std::string path; #ifdef _WIN32 path = shState->config().gameFolder + "\\Wallpaper\\" + name + ".bmp"; - Debug() << "[wallpaperSet]Setting wallpaper to" << path; + Debug() << "[wallpaperSet] Setting wallpaper to " << path; // Crapify the slashes size_t index = 0; for (;;) { @@ -301,7 +318,7 @@ end: colorArrType = g_type_from_name("GPtrArray_GValue_"); if (!colorArrType) { // Let's do some debug output here and skip changing the color - Debug() << "[wallpaperSet]WALLPAPER ERROR: xfconf-query call returned" << colorCommandRes; + Debug() << "[wallpaperSet] WALLPAPER ERROR: xfconf-query call returned" << colorCommandRes; return Qnil; } } @@ -349,6 +366,11 @@ end: Debug() << "[wallpaperSet] Wallpaper command:" << command.str(); int result = system(command.str().c_str()); Debug() << "[wallpaperSet ] Result:" << result; + } else if (IsFeh == true) { + //path + printf("[wallpaperSet] Trying set wallpapers via feh\n"); + std::string cmd = std::string("feh --bg-scale '") + path + "'"; + std::system(cmd.c_str()); } else { std::ifstream srcHint(gameDirStr + path); std::ofstream dstHint(fallbackPath); @@ -473,6 +495,8 @@ RB_METHOD(wallpaperReset){ Debug() << "[wallpaperReset] Reset wallpaper command:" << command.str(); int result = system(command.str().c_str()); Debug() << "[wallpaperReset] Reset result:" << result; + } else if (IsNitrogen == true){ + system("nitrogen --restore"); } else { if (remove(fallbackPath.c_str()) != 0) { Debug() << "[wallpaperReset] Failed to delete:" << fallbackPath;