Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
from gi.repository import Gio Gio.Settings("org.gnome.desktop.background").set_string("foo", "bar")
但问题是,键“foo”没有定义,有没有办法使用 Python 创建这个键?
我希望它存储一些用户桌面首选项,还是应该通过其他方式完成?
好吧,不可能在“运行时”执行此操作,因为键是从编译的形式中使用的……所以您需要在模式文件中添加注释,然后运行它。
glib-compile-schemas