Skip to content
Snippets Groups Projects
Commit 5b2b9341 authored by akiraohgaki's avatar akiraohgaki
Browse files

Apply aurorae theme with kde

parent ec53bf51
Branches
Tags
No related merge requests found
......@@ -99,7 +99,8 @@ bool SystemHandler::isApplicableType(const QString &installType) const
applicableTypes << "wallpapers"
<< "icons"
<< "cursors"
<< "plasma_desktopthemes";
<< "plasma_desktopthemes"
<< "aurorae_themes";
}
else if (desktop == "gnome") {
applicableTypes << "wallpapers"
......@@ -134,6 +135,9 @@ bool SystemHandler::applyFile(const QString &path, const QString &installType) c
else if (installType == "plasma_desktopthemes") {
return applyKdePlasmaDesktoptheme(path);
}
else if (installType == "aurorae_themes") {
return applyKdeAuroraeTheme(path);
}
}
else if (desktop == "gnome") {
if (installType == "wallpapers") {
......@@ -266,6 +270,32 @@ bool SystemHandler::applyKdePlasmaDesktoptheme(const QString &path) const
return true;
}
bool SystemHandler::applyKdeAuroraeTheme(const QString &path) const
{
auto themeName = QFileInfo(path).fileName();
auto message = QDBusMessage::createMethodCall("org.kde.plasmashell", "/PlasmaShell", "org.kde.PlasmaShell", "evaluateScript");
QString script;
QTextStream out(&script);
out << "var c = ConfigFile('kwinrc');"
<< "c.group = 'org.kde.kdecoration2';"
<< "c.writeEntry('library', 'org.kde.kwin.aurorae');"
<< "c.writeEntry('theme', '__aurorae__svg__" + themeName + "');";
QVariantList arguments;
arguments << QVariant(script);
message.setArguments(arguments);
auto reply = QDBusConnection::sessionBus().call(message);
if (reply.type() == QDBusMessage::ErrorMessage) {
qWarning() << reply.errorMessage();
return false;
}
return true;
}
bool SystemHandler::applyGnomeWallpaper(const QString &path) const
{
QStringList arguments{"set", "org.gnome.desktop.background", "picture-uri", "file://" + path};
......
......@@ -27,6 +27,7 @@ private:
bool applyKdeIcon(const QString &path) const;
bool applyKdeCursor(const QString &path) const;
bool applyKdePlasmaDesktoptheme(const QString &path) const;
bool applyKdeAuroraeTheme(const QString &path) const;
bool applyGnomeWallpaper(const QString &path) const;
bool applyGnomeIcon(const QString &path) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment