Skip to content

Commit

Permalink
Merge pull request #580 from lucky9loogn/fix/ubuntu-blur-behind-segme…
Browse files Browse the repository at this point in the history
…ntation-fault

fix: 修复了在 Ubuntu 中启用亚克力效果无效且导致程序崩溃的问题
  • Loading branch information
zhuzichu520 authored Dec 27, 2024
2 parents fb720b2 + 3a34e98 commit 1a8e3d5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/FluTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a8e3d5

Please sign in to comment.