From patchwork Mon Dec 12 20:58:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: florhizome X-Patchwork-Id: 45219 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 511DD27BBEC; Mon, 12 Dec 2022 21:00:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0B47327BBE9 for ; Mon, 12 Dec 2022 21:00:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4puF-0003Bg-Gj; Mon, 12 Dec 2022 16:00:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4pu7-0003Ak-Dd for guix-patches@gnu.org; Mon, 12 Dec 2022 16:00:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4pu7-0002jO-0G for guix-patches@gnu.org; Mon, 12 Dec 2022 16:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4pu6-0003wc-Rg for guix-patches@gnu.org; Mon, 12 Dec 2022 16:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60000] [PATCH v2] gnu: Add lxappearance-gtk3-wayland References: <25be7bfd74e41506a0c80fe435b7fdc5eda6bafe.1670842263.git.florhizome@posteo.net> In-Reply-To: <25be7bfd74e41506a0c80fe435b7fdc5eda6bafe.1670842263.git.florhizome@posteo.net> Resent-From: florhizome@posteo.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Dec 2022 21:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60000 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60000@debbugs.gnu.org Cc: florhizome Received: via spool by 60000-submit@debbugs.gnu.org id=B60000.167087875715092 (code B ref 60000); Mon, 12 Dec 2022 21:00:02 +0000 Received: (at 60000) by debbugs.gnu.org; 12 Dec 2022 20:59:17 +0000 Received: from localhost ([127.0.0.1]:55324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4ptM-0003vK-76 for submit@debbugs.gnu.org; Mon, 12 Dec 2022 15:59:17 -0500 Received: from mout01.posteo.de ([185.67.36.65]:34947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4ptJ-0003vC-JZ for 60000@debbugs.gnu.org; Mon, 12 Dec 2022 15:59:14 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 62427240029 for <60000@debbugs.gnu.org>; Mon, 12 Dec 2022 21:59:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1670878747; bh=7nSlkOVj+uT8lU+5kacp91QTXtahRETOp1LMPDdy20w=; h=From:To:Cc:Subject:Date:From; b=HkndWbN4MiTcZIxGd1AjzKFLvwlLd+VtiIQHNFg2WE0hIqHr+NNWCWKQZATvA19Gn x4oOW41Jh8xslb8xd/yr1bpjU8Y8gHUTWoVyBDRzI5M45oFB89hIC3hE5vdrR3Fhf2 z5ZdQyVobRkgXwU7kcBybhJ/GYMU20wkCH4KUVWe1igonKWlXpnsoNHpCLNH5Qr2jo ODggp570EB0x8Gg8WLoqjd/0Ghyc3BzBEbH2ryW42rYY0zhUvgOsba/ahbv+hoe/R6 rV/+uJEPkEgyW3Py3se/PcBUQ0/0vLF8Ey+8MAC3xum2vthcwc+98M6vV1+BF9cM0W NnfinfOvGJIdA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NWDWZ5hlCz6tmf; Mon, 12 Dec 2022 21:59:06 +0100 (CET) From: florhizome@posteo.net Date: Mon, 12 Dec 2022 20:58:56 +0000 Message-Id: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: florhizome oops, forgot the patches!! should I pick some better names? * gnu/packages/patches/lxappearance-gtk3-01-only-do-x11-on-x11.patch: New file. * gnu/packages/patches/lxappearance-gtk3-02-set-some-settings-gsettings.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them here. * gnu/packages/lxde.scm (lxappearance-gtk3-wayland): New variable. --- gnu/local.mk | 2 + gnu/packages/lxde.scm | 29 +++ ...ppearence-gtk3-01-only-do-x11-on-x11.patch | 41 ++++ ...-gtk3-02-set-some-settings-gsettings.patch | 184 ++++++++++++++++++ 4 files changed, 256 insertions(+) create mode 100644 gnu/packages/patches/lxappearence-gtk3-01-only-do-x11-on-x11.patch create mode 100644 gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch base-commit: 0ce1f82e5aaac951b21d579eb46bf75cfe6713c0 prerequisite-patch-id: 36ae907c0ae2cbc001f774c0514ab217855270c2 prerequisite-patch-id: 2c99b804c1a929fc9d74b4c3d92263cbd296f785 prerequisite-patch-id: 2525aea715c2eb5be5f61e2e14296a36898413ca prerequisite-patch-id: f7afbf36e2776eced1e69090ec127a40456efca4 prerequisite-patch-id: ba73cf06ab2610e36d03df1f6b6a1c4b8f271cda prerequisite-patch-id: 9ac4b32603488e776af63831ff13406c649a8686 prerequisite-patch-id: 1cec3e6ed7a13938c53c24f816056d98b2b005c7 prerequisite-patch-id: 011ca6e0eaf4ea7077787d7030f193836c30aa82 prerequisite-patch-id: 4243cf3f6370445e6d583f03231e87921f541cc2 prerequisite-patch-id: 6c88bfec7b2fa53face9523329de4a9102149772 prerequisite-patch-id: d1bed6e8da46c3d6f4017546f7a00c001e814fe1 prerequisite-patch-id: 1ff1bcd9503a2b38ca7cc59ebdcebb45f970cf1a prerequisite-patch-id: cb8f4f83e84db03ffa3c6be6c6b0df2ef0b59422 prerequisite-patch-id: 709b4522fd225f3c28bb2721e5dd9a20014ce131 prerequisite-patch-id: a02e8c00e53bf941c9049360c58959d2ebcf9608 prerequisite-patch-id: ba6a99be5ee43b2dd1cd45f73e9b04864187b1e4 prerequisite-patch-id: fc6e006241c41b19b4020981417823fd7a8cf931 diff --git a/gnu/local.mk b/gnu/local.mk index 86eb754352..9404e942eb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1514,6 +1514,8 @@ dist_patch_DATA = \ %D%/packages/patches/lua-5.4-liblua-so.patch \ %D%/packages/patches/luit-posix.patch \ %D%/packages/patches/lvm2-static-link.patch \ + %D%/packages/patches/lxappearance-gtk3-01-set-some-settings-gsettings.patch \ + %D%/packages/patches/lxappearance-gtk3-02-only-do-x11-on-x11.patch \ %D%/packages/patches/mailutils-variable-lookup.patch \ %D%/packages/patches/make-impure-dirs.patch \ %D%/packages/patches/mariadb-link-libatomic.patch \ diff --git a/gnu/packages/lxde.scm b/gnu/packages/lxde.scm index 0657db6eb8..bc0adc65eb 100644 --- a/gnu/packages/lxde.scm +++ b/gnu/packages/lxde.scm @@ -124,6 +124,35 @@ (define-public lxappearance (home-page "https://www.lxde.org/") (license license:gpl2+))) +(define-public lxappearance-gtk3-wayland + (package + (inherit lxappearance) + (name "lxappearance-gtk3-wayland") + (version "0.6.3") + (source + (origin + (method url-fetch) + (uri + (string-append "mirror://sourceforge/lxde/" + "LXAppearance/lxappearance-" version ".tar.xz")) + (sha256 + (base32 "0f4bjaamfxxdr9civvy55pa6vv9dx1hjs522gjbbgx7yp1cdh8kj")) + (patches + (search-patches + ;;patches are created from github issues + "lxappearence-gtk3-01-only-do-x11-on-x11.patch" + "lxappearence-gtk3-02-set-some-settings-gsettings.patch")))) + (build-system gnu-build-system) + (inputs (list gtk+ dbus dbus-glib)) + (arguments '(#:configure-flags '("--enable-gtk3=yes" "--enable-dbus=yes"))) + (synopsis "LXDE GTK+ theme switcher") + (description "LXAppearance is a desktop-independent GTK+ theme switcher +able to change themes, icons, and fonts used by GTK+ applications. +This version is configured for supporting GTK+3 and dbus, and applies +patches from LXDE's github to work on wayland as well.") + (home-page "https://lxde.github.io") + (license license:gpl2+))) + (define-public lxrandr (package (name "lxrandr") diff --git a/gnu/packages/patches/lxappearence-gtk3-01-only-do-x11-on-x11.patch b/gnu/packages/patches/lxappearence-gtk3-01-only-do-x11-on-x11.patch new file mode 100644 index 0000000000..01e7e18fc3 --- /dev/null +++ b/gnu/packages/patches/lxappearence-gtk3-01-only-do-x11-on-x11.patch @@ -0,0 +1,41 @@ +From a066e5136692a909b62f29158c4a4b0f007e2b22 Mon Sep 17 00:00:00 2001 +From: wb9688 +Date: Mon, 1 Mar 2021 16:40:34 +0100 +Subject: [PATCH] Only do X11-specific stuff on X11 + +--- + src/lxappearance.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/src/lxappearance.c b/src/lxappearance.c +index f31e794..4bd438a 100644 +--- a/src/lxappearance.c ++++ b/src/lxappearance.c +@@ -117,16 +117,20 @@ static gboolean check_lxde_dbus() + + static void check_lxsession() + { +- lxsession_atom = XInternAtom( GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "_LXSESSION", True ); +- if( lxsession_atom != None ) ++ GdkDisplay *display = gdk_display_get_default(); ++ if (GDK_IS_X11_DISPLAY(display)) + { +- XGrabServer( GDK_DISPLAY_XDISPLAY(gdk_display_get_default()) ); +- if( XGetSelectionOwner( GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), lxsession_atom ) ) ++ lxsession_atom = XInternAtom( GDK_DISPLAY_XDISPLAY(display), "_LXSESSION", True ); ++ if( lxsession_atom != None ) + { +- app.use_lxsession = TRUE; +- lxsession_name = g_getenv("DESKTOP_SESSION"); ++ XGrabServer( GDK_DISPLAY_XDISPLAY(display) ); ++ if( XGetSelectionOwner( GDK_DISPLAY_XDISPLAY(display), lxsession_atom ) ) ++ { ++ app.use_lxsession = TRUE; ++ lxsession_name = g_getenv("DESKTOP_SESSION"); ++ } ++ XUngrabServer( GDK_DISPLAY_XDISPLAY(display) ); + } +- XUngrabServer( GDK_DISPLAY_XDISPLAY(gdk_display_get_default()) ); + } + + /* Check Lxsession also with dbus */ diff --git a/gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch b/gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch new file mode 100644 index 0000000000..00996b9f28 --- /dev/null +++ b/gnu/packages/patches/lxappearence-gtk3-02-set-some-settings-gsettings.patch @@ -0,0 +1,184 @@ +From 35a6bd68317972b7bfccf546de04060e09dbab93 Mon Sep 17 00:00:00 2001 +From: wb9688 +Date: Tue, 2 Mar 2021 14:00:48 +0100 +Subject: [PATCH 1/2] Set some settings in GSettings as well + +--- + src/lxappearance.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 94 insertions(+) + +diff --git a/src/lxappearance.c b/src/lxappearance.c +index f31e794..18ba471 100644 +--- a/src/lxappearance.c ++++ b/src/lxappearance.c +@@ -462,6 +462,97 @@ static void lxappearance_save_gtkrc() + g_free(file_path); + } + ++#if GLIB_CHECK_VERSION(2, 40, 0) ++static void lxappearance_save_gsettings() ++{ ++ GSettingsSchemaSource *source = g_settings_schema_source_get_default(); ++ if (!source) ++ return; ++ ++ GSettingsSchema *schema = g_settings_schema_source_lookup(source, "org.gnome.desktop.interface", TRUE); ++ if (!schema) ++ return; ++ ++ GSettings *settings = g_settings_new("org.gnome.desktop.interface"); ++ ++ if (app.widget_theme && g_settings_schema_has_key(schema, "gtk-theme")) ++ g_settings_set_string(settings, "gtk-theme", app.widget_theme); ++ ++ if (app.icon_theme && g_settings_schema_has_key(schema, "icon-theme")) ++ g_settings_set_string(settings, "icon-theme", app.icon_theme); ++ ++ if (app.default_font && g_settings_schema_has_key(schema, "font-name")) ++ g_settings_set_string(settings, "font-name", app.default_font); ++ ++ if (app.cursor_theme && g_settings_schema_has_key(schema, "cursor-theme")) ++ g_settings_set_string(settings, "cursor-theme", app.cursor_theme); ++ ++ if (g_settings_schema_has_key(schema, "cursor-size")) ++ g_settings_set_int(settings, "cursor-size", app.cursor_theme_size); ++ ++ if (app.font_rgba && g_settings_schema_has_key(schema, "font-antialiasing") && g_settings_schema_has_key(schema, "font-rgba-order")) ++ { ++ if (!app.enable_antialising) ++ g_settings_set_string(settings, "font-antialiasing", "none"); ++ else if (strcmp(app.font_rgba, "none") == 0) ++ g_settings_set_string(settings, "font-antialiasing", "grayscale"); ++ else ++ { ++ g_settings_set_string(settings, "font-antialiasing", "rgba"); ++ if (strcmp(app.font_rgba, "rgb") == 0) ++ g_settings_set_string(settings, "font-rgba-order", "rgb"); ++ else if (strcmp(app.font_rgba, "bgr") == 0) ++ g_settings_set_string(settings, "font-rgba-order", "bgr"); ++ else if (strcmp(app.font_rgba, "vrgb") == 0) ++ g_settings_set_string(settings, "font-rgba-order", "vrgb"); ++ else if (strcmp(app.font_rgba, "vbgr") == 0) ++ g_settings_set_string(settings, "font-rgba-order", "vbgr"); ++ } ++ } ++ ++ if (app.hinting_style && g_settings_schema_has_key(schema, "font-hinting")) ++ { ++ if (!app.enable_hinting || strcmp(app.hinting_style, "hintnone") == 0) ++ g_settings_set_string(settings, "font-hinting", "none"); ++ else if (strcmp(app.hinting_style, "hintslight") == 0) ++ g_settings_set_string(settings, "font-hinting", "slight"); ++ else if (strcmp(app.hinting_style, "hintmedium") == 0) ++ g_settings_set_string(settings, "font-hinting", "medium"); ++ else if (strcmp(app.hinting_style, "hintfull") == 0) ++ g_settings_set_string(settings, "font-hinting", "full"); ++ } ++ ++ if (g_settings_schema_has_key(schema, "menus-have-icons")) ++ g_settings_set_boolean(settings, "menus-have-icons", app.menu_images); ++ ++ if (g_settings_schema_has_key(schema, "buttons-have-icons")) ++ g_settings_set_boolean(settings, "buttons-have-icons", app.button_images); ++ ++ if (g_settings_schema_has_key(schema, "toolbar-style")) ++ { ++ if (app.toolbar_style == 0) ++ g_settings_set_string(settings, "toolbar-style", "icons"); ++ else if (app.toolbar_style == 1) ++ g_settings_set_string(settings, "toolbar-style", "text"); ++ else if (app.toolbar_style == 2) ++ g_settings_set_string(settings, "toolbar-style", "both"); ++ else if (app.toolbar_style == 3) ++ g_settings_set_string(settings, "toolbar-style", "both-horiz"); ++ } ++ ++ if (g_settings_schema_has_key(schema, "toolbar-icons-size")) ++ { ++ if (app.toolbar_icon_size == 2) ++ g_settings_set_string(settings, "toolbar-icons-size", "small"); ++ else if (app.toolbar_icon_size == 3) ++ g_settings_set_string(settings, "toolbar-icons-size", "large"); ++ } ++ ++ g_settings_schema_unref(schema); ++ g_object_unref(settings); ++} ++#endif ++ + static void lxappearance_save_lxsession() + { + char* rel_path = g_strconcat("lxsession/", lxsession_name, "/desktop.conf", NULL); +@@ -532,6 +623,9 @@ static void on_dlg_response(GtkDialog* dlg, int res, gpointer user_data) + if(app.use_lxsession) + lxappearance_save_lxsession(); + lxappearance_save_gtkrc(); ++#if GLIB_CHECK_VERSION(2, 40, 0) ++ lxappearance_save_gsettings(); ++#endif + + reload_all_programs(); + + +From 703accd389b9dc6e9f5ed4fc3ffc23aacf893bc1 Mon Sep 17 00:00:00 2001 +From: wb9688 +Date: Tue, 16 Mar 2021 19:20:08 +0100 +Subject: [PATCH 2/2] Remove toolbar icon size options other than large and + small + +--- + data/ui/lxappearance.glade | 12 ------------ + src/other.c | 4 ++-- + 2 files changed, 2 insertions(+), 14 deletions(-) + +diff --git a/data/ui/lxappearance.glade b/data/ui/lxappearance.glade +index 19554cc..892c46d 100644 +--- a/data/ui/lxappearance.glade ++++ b/data/ui/lxappearance.glade +@@ -2125,24 +2125,12 @@ + + + +- +- Same as menu items +- + + Small toolbar icon + + + Large toolbar icon + +- +- Same as buttons +- +- +- Same as drag icons +- +- +- Same as dialogs +- + + + +diff --git a/src/other.c b/src/other.c +index d79b28d..aaaeb41 100644 +--- a/src/other.c ++++ b/src/other.c +@@ -30,7 +30,7 @@ static void on_tb_style_changed(GtkComboBox* combo, gpointer user_data) + + static void on_tb_icon_size_changed(GtkComboBox* combo, gpointer user_data) + { +- app.toolbar_icon_size = gtk_combo_box_get_active(combo) + GTK_ICON_SIZE_MENU; ++ app.toolbar_icon_size = gtk_combo_box_get_active(combo) + GTK_ICON_SIZE_SMALL_TOOLBAR; + lxappearance_changed(); + } + +@@ -72,7 +72,7 @@ void other_init(GtkBuilder* b) + g_signal_connect(app.tb_style_combo, "changed", G_CALLBACK(on_tb_style_changed), NULL); + + app.tb_icon_size_combo = GTK_WIDGET(gtk_builder_get_object(b, "tb_icon_size")); +- idx = app.toolbar_icon_size - GTK_ICON_SIZE_MENU; ++ idx = app.toolbar_icon_size - GTK_ICON_SIZE_SMALL_TOOLBAR; + gtk_combo_box_set_active(GTK_COMBO_BOX(app.tb_icon_size_combo), idx); + g_signal_connect(app.tb_icon_size_combo, "changed", G_CALLBACK(on_tb_icon_size_changed), NULL); +