سؤال

from gi.repository import Gio
Gio.Settings("org.gnome.desktop.background").set_string("foo", "bar")

But problem is, that key "foo" is not defined, is there a way how to create this key using Python?

I want it to store some users desktop preferences, or should it be done by other way?

هل كانت مفيدة؟

المحلول

Well it is not possible to do this "on run", because keys are used from compiled form... So you will need to add note to schema file and then run it.

glib-compile-schemas
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top