From 65059c839827f229297a1d4f44271a6fcc2447b6 Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Wed, 14 Jun 2017 19:15:43 +0900
Subject: [PATCH] Apply cursor with gnome

---
 app/src/handlers/systemhandler.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/src/handlers/systemhandler.cpp b/app/src/handlers/systemhandler.cpp
index 7ea535d..16d47bc 100644
--- a/app/src/handlers/systemhandler.cpp
+++ b/app/src/handlers/systemhandler.cpp
@@ -101,11 +101,11 @@ bool SystemHandler::isApplicableType(const QString &installType) const
              && (desktop == "kde" || desktop == "gnome" || desktop == "xfce")) {
         return true;
     }
-    /*else if (installType == "cursors"
+    else if (installType == "cursors"
              && (desktop == "kde" || desktop == "gnome" || desktop == "xfce")) {
         return true;
     }
-    else if ((installType == "aurorae_themes" && desktop == "kde")
+    /*else if ((installType == "aurorae_themes" && desktop == "kde")
              || (installType == "metacity_themes" && desktop == "gnome")
              || (installType == "xfwm4_themes" && desktop == "xfce")) {
         return true;
@@ -123,10 +123,10 @@ bool SystemHandler::applyFile(const QString &path, const QString &installType) c
         else if (installType == "icons") {
             return applyIcon(path);
         }
-        /*else if (installType == "cursors") {
+        else if (installType == "cursors") {
             return applyCursor(path);
         }
-        else if (installType == "aurorae_themes"
+        /*else if (installType == "aurorae_themes"
                  || installType == "metacity_themes"
                  || installType == "xfwm4_themes") {
             return applyWindowTheme(path);
@@ -217,6 +217,9 @@ bool SystemHandler::applyCursor(const QString &path) const
     if (desktop == "kde") {
     }
     else if (desktop == "gnome") {
+        auto themeName = QFileInfo(path).fileName();
+        QStringList arguments{"set", "org.gnome.desktop.interface", "cursor-theme", themeName};
+        return QProcess::startDetached("gsettings", arguments);
     }
     else if (desktop == "xfce") {
     }
-- 
GitLab