Skip to content
Snippets Groups Projects
Commit 86fb1cae authored by akiraohgaki's avatar akiraohgaki
Browse files

Apply shell theme with gnome

parent e4a4ed9b
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,11 @@ bool SystemHandler::isApplicableType(const QString &installType) const
applicableTypes << "wallpapers";
}
else if (desktop == "gnome") {
applicableTypes << "wallpapers" << "icons" << "cursors" << "gtk3_themes";
applicableTypes << "wallpapers"
<< "icons"
<< "cursors"
<< "gtk3_themes"
<< "gnome_shell_themes";
}
else if (desktop == "xfce") {
applicableTypes << "wallpapers";
......@@ -132,6 +136,9 @@ bool SystemHandler::applyFile(const QString &path, const QString &installType) c
else if (installType == "gtk3_themes") {
return applyGnomeGtk3Theme(path);
}
else if (installType == "gnome_shell_themes") {
return applyGnomeGnomeShellTheme(path);
}
}
else if (desktop == "xfce") {
if (installType == "wallpapers") {
......@@ -199,6 +206,13 @@ bool SystemHandler::applyGnomeGtk3Theme(const QString &path) const
return QProcess::startDetached("gsettings", arguments);
}
bool SystemHandler::applyGnomeGnomeShellTheme(const QString &path) const
{
auto themeName = QFileInfo(path).fileName();
QStringList arguments{"set", "org.gnome.shell.extensions.user-theme", "name", themeName};
return QProcess::startDetached("gsettings", arguments);
}
bool SystemHandler::applyXfceWallpaper(const QString &path) const
{
auto message = QDBusMessage::createMethodCall("org.xfce.Xfconf", "/org/xfce/Xfconf", "org.xfce.Xfconf", "SetProperty");
......
......@@ -29,6 +29,7 @@ private:
bool applyGnomeIcon(const QString &path) const;
bool applyGnomeCursor(const QString &path) const;
bool applyGnomeGtk3Theme(const QString &path) const;
bool applyGnomeGnomeShellTheme(const QString &path) const;
bool applyXfceWallpaper(const QString &path) const;
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment