Patchwork gnome-tweak-tool tweaks

login
register
mail settings
Submitter Jan Nieuwenhuizen
Date June 6, 2016, 6:09 a.m.
Message ID <87wpm23l2w.fsf@gnu.org>
Download mbox | patch
Permalink /patch/12785/
State New
Headers show

Comments

Jan Nieuwenhuizen - June 6, 2016, 6:09 a.m.
Hi,

When starting gnome-tweak-tool, it prints a warning

    GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.

The patch below has gnome-tweak-tool communicate with gsettings instead
of using the `memory.  I'm not sending it as a fix yet because 
gnome-tweak-tool does not list any themes, as davexunit reported.

I'm attaching the log that I get when building it, there's a warning
about xml files not being written and collisions, could that be the
cause of missing themes?

Greetings, Jan
Ludovic Courtès - June 10, 2016, 12:24 p.m.
Hello!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> When starting gnome-tweak-tool, it prints a warning
>
>     GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
>
> The patch below has gnome-tweak-tool communicate with gsettings instead
> of using the `memory.  I'm not sending it as a fix yet because 
> gnome-tweak-tool does not list any themes, as davexunit reported.

So does the patch fix something?  (Sorry, I’m quite ignorant about
GNOMEy things.)

> I/O error : Permission denied
> I/O error : Permission denied
> Failed to write XML file; For permission problems, try rerunning as root

I found that string comes from ‘shared-mime-info’, which is itself used
by the ‘xdg-mime-database’ hook in (guix profiles) (a hook that runs
when the profile is created to update the MIME database):

--8<---------------cut here---------------start------------->8---
static gboolean save_xml_file(xmlDocPtr doc, const gchar *filename, GError **error)
{
#if LIBXML_VERSION > 20400
	if (xmlSaveFormatFileEnc(filename, doc, "utf-8", 1) < 0)
	{
		g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
			    "Failed to write XML file; For permission problems, try rerunning as root");
		return FALSE;
	}
#else
--8<---------------cut here---------------end--------------->8---

宋文武: any idea what the problem might be?  Perhaps
‘update-mime-database’ is trying to write to /gnu/store/…-something?

Also, it’s a problem that ‘update-mime-database’ returns 0 here, as
seems to be the case.

Thanks,
Ludo’.
=?utf-8?B?5a6L5paH5q2m?= - June 11, 2016, 3:49 a.m.
ludo@gnu.org (Ludovic Courtès) writes:

> [...]
>
>> I/O error : Permission denied
>> I/O error : Permission denied
>> Failed to write XML file; For permission problems, try rerunning as root
>
> I found that string comes from ‘shared-mime-info’, which is itself used
> by the ‘xdg-mime-database’ hook in (guix profiles) (a hook that runs
> when the profile is created to update the MIME database):
>
> static gboolean save_xml_file(xmlDocPtr doc, const gchar *filename, GError **error)
> {
> #if LIBXML_VERSION > 20400
> 	if (xmlSaveFormatFileEnc(filename, doc, "utf-8", 1) < 0)
> 	{
> 		g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
> 			    "Failed to write XML file; For permission problems, try rerunning as root");
> 		return FALSE;
> 	}
> #else
>
> 宋文武: any idea what the problem might be?  Perhaps
> ‘update-mime-database’ is trying to write to /gnu/store/…-something?
Yep, it happends when '$out/share/mime/application' is not writable.
The xml files under 'application' are going to be generated by
update-mime-database, and the shared-mime-info package has it
pre-generated, so after union "share/mime", an un-writable 'application'
directory point to the store will cause the problem.

Commit 359f06aa fix this by union the "share/mime/packages" directory.

>
> Also, it’s a problem that ‘update-mime-database’ returns 0 here, as
> seems to be the case.
It returns 256 here for the problem, but the derivation still built and
profile got updated, I have no idea about this :-

Does a failing hook (returns #f) supposed to top the profile update?
Jan Nieuwenhuizen - June 11, 2016, 7:21 a.m.
Ludovic Courtès writes:

>> The patch below has gnome-tweak-tool communicate with gsettings instead
>> of using the `memory.  I'm not sending it as a fix yet because 
>> gnome-tweak-tool does not list any themes, as davexunit reported.
>
> So does the patch fix something?  (Sorry, I’m quite ignorant about
> GNOMEy things.)

That depends on how you look at it.  It takes away the cause of the
warning message, so now settings are sent to gnome-settings instead
of kept in-memory.  However, I'm still not sure that gnome-settings
saves its settings, which should happen upon logout which we do not
have yet.

So one chain in the link is fixed, but I think there is still another
link that is broken.

Greetings,
Jan
Ludovic Courtès - June 12, 2016, 8:21 p.m.
Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> Ludovic Courtès writes:
>
>>> The patch below has gnome-tweak-tool communicate with gsettings instead
>>> of using the `memory.  I'm not sending it as a fix yet because 
>>> gnome-tweak-tool does not list any themes, as davexunit reported.
>>
>> So does the patch fix something?  (Sorry, I’m quite ignorant about
>> GNOMEy things.)
>
> That depends on how you look at it.  It takes away the cause of the
> warning message, so now settings are sent to gnome-settings instead
> of kept in-memory.  However, I'm still not sure that gnome-settings
> saves its settings, which should happen upon logout which we do not
> have yet.
>
> So one chain in the link is fixed, but I think there is still another
> link that is broken.

To put it differently: do we need to apply it, or does it just serve as
an illustration for the discussion?  :-)

Ludo’.
Jan Nieuwenhuizen - June 12, 2016, 9:18 p.m.
Ludovic Courtès writes:

> To put it differently: do we need to apply it, or does it just serve as
> an illustration for the discussion?  :-)

It's okay to apply it, but I suspect more coming.  I think/hope
davexunit found something wrt XDG_DATA_DIRS and theming, kori reported
libsoup and gnome-desktop were needed, which I also don't know what to
do with yet.

Greetings,
Jan

Patch

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 8384c76..c9463e8 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5170,7 +5170,8 @@  desktop.  It supports multiple calendars, monthly view and yearly view.")
      `(("python" ,python-2)
        ("python2-pygobject" ,python2-pygobject)))
     (propagated-inputs
-     `(("libnotify" ,libnotify)
+     `(("dconf" ,dconf)
+       ("libnotify" ,libnotify)
        ("gobject-introspection" ,gobject-introspection)
        ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
        ("gtk+" ,gtk+)))