milan jurkulák 2 vuotta sitten
vanhempi
sitoutus
b5a4bcfc57

+ 4 - 2
src/main/kotlin/eu/mjdev/desktop/data/DesktopFile.kt

@@ -64,8 +64,10 @@ class DesktopFile(
             else -> false
         }
 
-        fun create(path: String): DesktopFile = DesktopFile(File(path).apply {
-            createNewFile()
+        fun create(path: String): DesktopFile = create(File(path).apply {
+            if (!exists()) createNewFile()
         })
+
+        fun create(file: File): DesktopFile = DesktopFile(file)
     }
 }

+ 18 - 2
src/main/kotlin/eu/mjdev/desktop/theme/gtk/GtkTheme.kt

@@ -9,7 +9,23 @@ class GtkTheme(
     val themeName: String = "mjdev",
     val api: DesktopProvider,
     val themesDir: File = File(api.homeDir, ".themes"),
-    val themeDir: File = File(themesDir, themeName)
+    val themeDir: File = File(themesDir, themeName),
+    val themeDesktopFile: File = File(themeDir, "index.theme")
 ) {
-    val desktopFile: DesktopFile = DesktopFile.create("") // todo
+    val desktopFile: DesktopFile = DesktopFile.create(themeDesktopFile) // todo
+    /*
+    [Desktop Entry]
+    Type=X-GNOME-Metatheme
+    Name=Ambiance
+    Comment=Ubuntu Ambiance theme
+    Encoding=UTF-8
+
+    [X-GNOME-Metatheme]
+    GtkTheme=Ambiance
+    MetacityTheme=Ambiance
+    IconTheme=ubuntu-mono-dark
+    CursorTheme=DMZ-White
+    ButtonLayout=close,minimize,maximize:
+    X-Ubuntu-UseOverlayScrollbars=true
+     */
 }