我试图了解 Gconf、Dconf 和 Gsettings 的工作原理以及它们之间的关系。
我所知道的是:
我知道对于 Gconf 有一个 GUI - Gconf-editor,对于 Dconf - Dconf-editor。
所以:
我已经阅读了很多关于新的 Ubuntu 配置工具的讨论:gconf 被 dconf 取代。
为什么要进行这种更改?为什么会有如此多的争论?创建一个gconf2dconf迁移工具是不是太难了?
我看到一些答案,人们发帖以在 gconf-editor 中设置一个键,但是我的菜单中没有 gconf-editor 的条目。
如何运行它以及如何使用它来设置人们推荐的密钥?
gconf 和 dconf 编辑器都可用。考虑到 dconf 的变化,我们应该仍然使用 gconf 吗?运行 11.10 时,gconf 中的更改实际上有什么作用吗?
大多数人都知道,您可以通过点击Ctrl+在视觉位置条目和 Nautilus 中基于文本的条目之间切换L。
当我尝试在 gconf-editor 中永久设置此值时,它不存在。当我尝试通过终端执行此操作时,这是我收到的消息:
No value to set for key: /apps/nautilus/preferences/always_use_location_entry
我仍然可以通过Ctrl+在两者之间切换L,但我对修复感到困惑。
经过一番研究,我发现我可以使用gsettings
终端中的命令快速设置配置选项,而不是安装dconf-editor
orgconf-editor
或 CCSM。
但是我们需要 SCHEMA/PATH 和 KEY 来设置值。
语法是:
gsettings set SCHEMA[:PATH] KEY VALUE
Run Code Online (Sandbox Code Playgroud)
例如,从不自动隐藏启动器:
gsettings set com.canonical.Unity2d.Launcher hide-mode 0
Run Code Online (Sandbox Code Playgroud)
并且,对于不与启动器重叠的窗口:
gsettings set com.canonical.Unity2d.Launcher use-strut true
Run Code Online (Sandbox Code Playgroud)
那么,我在哪里可以获得可以使用 gsettings 设置的所有 SCHEMA / PATH / KEY 的列表?
不,请不要建议该gsettings list-keys
命令,因为我不知道可能有数百个可用的模式。
从 Ubuntu 14.10 升级到 15.10 后,似乎不再支持gnome-terminal
使用更改首选项gconftool-2
。我猜这个问题与Gconf 与 GSettings 迁移有关。
现在,我想更改我的一些旧脚本(因为它们在 Ubuntu 15.10 中已损坏)以使用dconf
/gesettings
而不是gconftool-2
.
例如,在 Ubuntu 14.10(gnome-terminal
版本 3.6.2)上,我可以使用以下方法设置Default
配置文件中的列数:
$ gconftool-2 --set /apps/gnome-terminal/profiles/Default/default_size_columns \
--type=int 140
$ gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_custom_default_size \
--type=bool true
Run Code Online (Sandbox Code Playgroud)
现在,在 Ubuntu 15.10 中,输入:
$ dconf list /org/gnome/terminal/legacy/
Run Code Online (Sandbox Code Playgroud)
给
profiles:/
schema-version
Run Code Online (Sandbox Code Playgroud)
然而
$ gsettings list-relocatable-schemas | grep Terminal
Run Code Online (Sandbox Code Playgroud)
给
org.gnome.Terminal.SettingsList
org.gnome.Terminal.Legacy.Profile
org.gnome.Terminal.Legacy.Keybindings
Run Code Online (Sandbox Code Playgroud)
上面的输出让我感到困惑:
/org/gnome/terminal/legacy/profiles:/
路径dconf
但没有org.gnome.Terminal.Legacy.Profiles
(注意尾随s
)模式 ID …安装某些软件时出现此错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up gconf2 (3.2.0-0ubuntu1) ...
I/O warning : failed to load external entity "/usr/share/gconf/schemas/compiz-wobbly.schemas"
Failed to open `/usr/share/gconf/schemas/compiz-wobbly.schemas': No such file or directory
I/O warning : failed to load external entity "/usr/share/gconf/schemas/gwd.schemas"
Failed to open `/usr/share/gconf/schemas/gwd.schemas': No such …
Run Code Online (Sandbox Code Playgroud) 关键/desktop/gnome/url-handlers/magnet
的gconf-editor
缺失。
如何分配磁力链接以使用 qbittorrent?
如果可以轻松设置 url 处理程序,那就太好了。在进行全新安装时,我总是为此而苦恼。我也想设置 subl:// 来打开 sublime text 2。
编辑:无论我用来激活链接的应用程序如何,我都希望它能够工作。我正在使用 Chrome,但 IMO 操作系统 (Ubuntu) 应该处理应用程序不知道如何处理的链接 - 它可以处理,那么如何配置呢?
EDIT2:这篇文章详细介绍了如何让 VIM 中的文本编辑器处理 vim:// url,也许这可以应用于磁力链接。即创建定义 MimeType 处理程序的桌面快捷方式,然后刷新缓存。(现在无法尝试,因为我使用的是 12.04)。 http://www.tkalin.com/blog_posts/using-console-vim-as-vim-protocol-handler-in-ubuntu
我可以按照以下示例输出单个键值:
gconftool-2 --get /apps/panel/applets/clock_screen0/object_type
bonobo-applet
Run Code Online (Sandbox Code Playgroud)
如何转储整个 gconf 数据库?... 键名和值
gconf ×10
dconf ×5
gsettings ×3
command-line ×1
compiz ×1
dpkg ×1
gnome ×1
nautilus ×1
preferences ×1
qbittorrent ×1