Package: lxappearance
Version: 0.5.1-1
Severity: normal

Hello

I use openbox with lxappearance on sid.
But lxappearance does not work correctly for gtk3

I found the problem : the configuration of gtk-3.0 is not in ~/.config/gtk-3.0/,
the last line of settings.ini is not recognized, and there are quotes.

I attach a patch

Excuse me for my English

Thanks



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lxappearance depends on:
ii  libatk1.0-0                   2.0.1-2    ATK accessibility toolkit
ii  libc6                         2.13-13    Embedded GNU C Library: Shared lib
ii  libcairo2                     1.10.2-6.1 The Cairo 2D vector graphics libra
ii  libfontconfig1                2.8.0-3    generic font configuration library
ii  libfreetype6                  2.4.4-2    FreeType 2 font engine, shared lib
ii  libgdk-pixbuf2.0-0            2.23.5-3   GDK Pixbuf library
ii  libglib2.0-0                  2.28.6-1   The GLib library of C routines
ii  libgtk2.0-0                   2.24.5-4   GTK+ graphical user interface libr
ii  libpango1.0-0                 1.28.4-2   Layout and rendering of internatio
ii  libx11-6                      2:1.4.4-1  X11 client-side library

Versions of packages lxappearance recommends:
ii  gtk2-engines                  1:2.20.1-1 theme engines for GTK+ 2.x

lxappearance suggests no packages.

-- no debconf information
--- lxappearance.c	2011-07-29 16:50:19.000000000 +0200
+++ lxappearance-modif.c	2011-08-01 21:00:18.145117323 +0200
@@ -133,6 +133,7 @@
 }
 
 
+// for GTK2
 static void lxappearance_save_gtkrc()
 {
     static const char* tb_styles[]={
@@ -219,20 +220,101 @@
 
     g_file_set_contents(file_path, content->str, content->len, NULL);
 
-    /* Save also for GTK3 */
-    g_string_prepend(content, "[Settings] \n");
-    char* file_path_gtk3 = g_build_filename(g_get_home_dir(), "gtk-3.0", NULL);
-    char* file_path_settings = g_build_filename(g_get_home_dir(), "gtk-3.0", "settings.ini", NULL);
+    g_free(file_path);
+}
+
+// for GTK3
+static void lxappearance_save_settings()
+{
+    static const char* tb_styles[]={
+        "GTK_TOOLBAR_ICONS",
+        "GTK_TOOLBAR_TEXT",
+        "GTK_TOOLBAR_BOTH",
+        "GTK_TOOLBAR_BOTH_HORIZ"
+    };
+    static const char* tb_icon_sizes[]={
+        "GTK_ICON_SIZE_INVALID",
+        "GTK_ICON_SIZE_MENU",
+        "GTK_ICON_SIZE_SMALL_TOOLBAR",
+        "GTK_ICON_SIZE_LARGE_TOOLBAR",
+        "GTK_ICON_SIZE_BUTTON",
+        "GTK_ICON_SIZE_DND",
+        "GTK_ICON_SIZE_DIALOG"
+    };
+
+    char* file_path_gtk3 = g_build_filename(g_get_home_dir(), ".config", "gtk-3.0", NULL);
+    char* file_path_settings = g_build_filename(g_get_home_dir(), ".config", "gtk-3.0", "settings.ini", NULL);
 
     if (!g_file_test(file_path_gtk3, G_FILE_TEST_IS_DIR))
     {
         g_mkdir_with_parents(file_path_gtk3, 0755);
     }
 
+    GString* content = g_string_sized_new(512);
+    g_string_prepend(content, "[Settings] \n");
+    g_string_append(content,
+        "# DO NOT EDIT! This file will be overwritten by LXAppearance.\n"
+        "# Any customization should be done in ~/.gtkrc-2.0.mine instead.\n\n");
+    if(app.widget_theme)
+        g_string_append_printf(content,
+            "gtk-theme-name=%s\n", app.widget_theme);
+    if(app.icon_theme)
+        g_string_append_printf(content,
+            "gtk-icon-theme-name=%s\n", app.icon_theme);
+    if(app.default_font)
+        g_string_append_printf(content,
+            "gtk-font-name=%s\n", app.default_font);
+    if(app.cursor_theme)
+        g_string_append_printf(content,
+            "gtk-cursor-theme-name=%s\n", app.cursor_theme);
+    save_cursor_theme_name();
+
+    g_string_append_printf(content,
+        "gtk-cursor-theme-size=%d\n"
+        "gtk-toolbar-style=%s\n"
+        "gtk-toolbar-icon-size=%s\n"
+        "gtk-button-images=%d\n"
+        "gtk-menu-images=%d\n"
+#if GTK_CHECK_VERSION(2, 14, 0)
+        "gtk-enable-event-sounds=%d\n"
+        "gtk-enable-input-feedback-sounds=%d\n"
+#endif
+        "gtk-xft-antialias=%d\n"
+        "gtk-xft-hinting=%d\n"
+
+        , app.cursor_theme_size,
+        tb_styles[app.toolbar_style],
+        tb_icon_sizes[app.toolbar_icon_size],
+        app.button_images ? 1 : 0,
+        app.menu_images ? 1 : 0,
+#if GTK_CHECK_VERSION(2, 14, 0)
+        app.enable_event_sound ? 1 : 0,
+        app.enable_input_feedback ? 1 : 0,
+#endif
+        app.enable_antialising ? 1 : 0,
+        app.enable_hinting ? 1 : 0
+        );
+
+    if(app.hinting_style)
+        g_string_append_printf(content,
+            "gtk-xft-hintstyle=%s\n", app.hinting_style);
+
+    if(app.font_rgba)
+        g_string_append_printf(content,
+            "gtk-xft-rgba=%s\n", app.font_rgba);
+
+    if(app.color_scheme)
+    {
+        char* escaped = g_strescape(app.color_scheme, NULL);
+        g_string_append_printf(content,
+            "gtk-color-scheme=%s\n",
+            escaped);
+        g_free(escaped);
+    }
+
     g_file_set_contents(file_path_settings, content->str, content->len, NULL);
 
     g_string_free(content, TRUE);
-    g_free(file_path);
 }
 
 static void lxappearance_save_lxsession()
@@ -305,7 +387,10 @@
         if(app.use_lxsession)
             lxappearance_save_lxsession();
         else
+        {
             lxappearance_save_gtkrc();
+            lxappearance_save_settings();
+        }
 
         reload_all_programs();
 

Reply via email to