Skip to content

Commit 3a34e98

Browse files
committed
fix: 修复了在 Ubuntu 中启用亚克力效果无效且导致程序崩溃的问题
1 parent 1beb900 commit 3a34e98

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/FluTools.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,22 @@ QString FluTools::getWallpaperFilePath() {
282282
auto path = result.mid(startIndex + 7, result.length() - startIndex - 8);
283283
return path;
284284
}
285+
} else if (type == "ubuntu") {
286+
QProcess process;
287+
QStringList args;
288+
args << "get";
289+
args << "org.gnome.desktop.background";
290+
args << "picture-uri";
291+
process.start("gsettings", args);
292+
process.waitForFinished();
293+
QByteArray result = process.readAllStandardOutput().trimmed();
294+
result = result.mid(1, result.length() - 2);
295+
if (result.startsWith("file:///")) {
296+
auto path = result.mid(7);
297+
return path;
298+
}
285299
}
300+
return {};
286301
#elif defined(Q_OS_MACOS)
287302
QProcess process;
288303
QStringList args;

0 commit comments

Comments
 (0)