From 3a34e98d80411ab13520a75558166d9a69fa85d4 Mon Sep 17 00:00:00 2001 From: lucky9loogn Date: Thu, 26 Dec 2024 22:54:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=9C=A8=20U?= =?UTF-8?q?buntu=20=E4=B8=AD=E5=90=AF=E7=94=A8=E4=BA=9A=E5=85=8B=E5=8A=9B?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E6=97=A0=E6=95=88=E4=B8=94=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/FluTools.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/FluTools.cpp b/src/FluTools.cpp index dbe03a06..b279fed8 100644 --- a/src/FluTools.cpp +++ b/src/FluTools.cpp @@ -282,7 +282,22 @@ QString FluTools::getWallpaperFilePath() { auto path = result.mid(startIndex + 7, result.length() - startIndex - 8); return path; } + } else if (type == "ubuntu") { + QProcess process; + QStringList args; + args << "get"; + args << "org.gnome.desktop.background"; + args << "picture-uri"; + process.start("gsettings", args); + process.waitForFinished(); + QByteArray result = process.readAllStandardOutput().trimmed(); + result = result.mid(1, result.length() - 2); + if (result.startsWith("file:///")) { + auto path = result.mid(7); + return path; + } } + return {}; #elif defined(Q_OS_MACOS) QProcess process; QStringList args;