如何重置gnome字体配置?

如何将字体设置(实际字体和大小)重置为默认值?

(我在System-> Preferences-> Appearance-> Fonts中更改了一些值)

这对于Maverick中的新Ubuntu字体尤其重要 – 例如我很想知道默认设置是什么。

Ubuntu 15.10和之前

要重置使用System -> Preferences -> Appearance -> Fonts完成的gnome字体的自定义,请使用以下命令。

基本上这些命令通过删除gconf密钥的用户实例来删除自定义,在这种情况下,环境会回退到系统默认值。

 gconftool-2 --unset /desktop/gnome/interface/font_name gconftool-2 --unset /desktop/gnome/interface/document_font_name gconftool-2 --unset /desktop/gnome/interface/monospace_font_name gconftool-2 --unset /apps/metacity/general/titlebar_font gconftool-2 --unset /apps/nautilus/preferences/desktop_font 

虽然密钥标识符以name结尾(至少在前三个实例中),但是对它们存储的是完整的字体规范(如族/字体名称,大小,样式等)。

由于这些密钥存储在主目录中,因此它们将在共享主分区的所有ubuntu安装中生效。 主目录中的.gconf目录是存储所有这些信息的位置。

  1. 〜/ .gconf / desktop / gnome / interface /%gconf.xml存储信息
    • /桌面/ GNOME / interface / font_name首
    • /桌面/ GNOME /接口/ document_font_name
    • /桌面/ GNOME /接口/ monospace_font_name
  2. 〜/ .gconf / apps / metacity / general /%gconf.xml stores / apps / metacity / general / titlebar_font
  3. 〜/ .gconf / apps / nautilus / preferences /%gconf.xml stores / apps / nautilus / preferences / desktop_font

因此,重置字体信息的粗略方法可能是临时重命名/移动这些文件。 但是,这应该在用户的gnome会话未激活时完成(因此从tty会话a Ctrl+Alt+F1

当然,这些文件在同一类别中具有与字体属性无关的其他键,因此移动整个文件意味着这些文件的自定义也会丢失。 按键处理的方法是使用上面提到的gconftool-2。

Ubuntu 16.04及之后

gconftool-2已被Ubuntu 16.04+和其他基于GNOME的系统中的gsettings取代。

现在,您只需在终端窗口中运行以下命令即可重置所有桌面字体设置:

 gsettings reset org.gnome.desktop.interface font-name gsettings reset org.gnome.desktop.interface document-font-name gsettings reset org.gnome.desktop.interface monospace-font-name gsettings reset org.gnome.desktop.wm.preferences titlebar-font gsettings reset org.gnome.nautilus.desktop font gsettings reset org.gnome.desktop.interface text-scaling-factor 

希望能帮助到你。

将gconf-watcher复制并粘贴到PC上名为gconf-watcher的文件中。 Chmod它可执行。 在终端中运行它并使其保持运行。

SystemPreferencesAppearanceFonts更改每个设置。 查看gconf-watcher的输出以找出它存储在gconf树中的位置。

现在安装gconf-editor 。 它的外观和工作方式有点像Windows注册表编辑器。 用它来“取消”相关值。 知道“未设置”实际上意味着“重置”

顺便说一句,如果我问,为什么你想重置设置?

要更改Gnome-3上的设置,您可以使用gsettings

要重置用户的所有字体,请在用户终端上键入以下命令:

 gsettings reset org.gnome.desktop.interface monospace-font-name gsettings reset org.gnome.desktop.interface document-font-name gsettings reset org.gnome.desktop.interface font-name gsettings reset org.gnome.desktop.wm.preferences titlebar-font 

对于缩放因子这一个:

 gsettings reset org.gnome.desktop.interface text-scaling-factor 

要获取每个设置的当前配置,请将“reset”替换为“get”。

您也可以通过运行dconf-editor来使用GUI。

这是UbuntuGnome 17.04 Live Disc的截图。 当我使用Gnome时,我安装了Mate和Cinnamon Desktiop并注意到了一些更改的字体。 所以我使用ISO来截取屏幕截图并使用gnome tweak工具更改设置。

在此处输入图像描述

我在下面提到starkus – 对于这个漂亮的窗口,你需要安装包gnome-tweak-tools。

sudo apt-get install gnome-tweak-tools

sudo重启

然后你可以在“Schriften”中设置字体。 在“字体”中。

更改字体设置后,再次重新启动以获得系统范围内的结果。

尽管对于GNOME3来说答案是最新且可行的,但有一点需要注意,即使使用gsettings reset ...或gnome-tweak-tools’恢复默认按钮,您实际上也可能无法获得由分布。 例如,Ubuntu(使用Unity DE)附带Ubuntu字体作为默认界面字体,但如果您在此之上安装另一个DE,它可以更改此默认设置。

默认字体的值实际上来自/usr/share/glib-2.0/schemas目录中的gschema文件。 当我们安装桌面环境元数据包时,它会提供覆盖文件来更改这些默认值。

如果发生这种情况,您需要通过编写自定义gschema覆盖文件来手动恢复默认值。

每个GNOME变体的覆盖文件

对于每种情况,使用此名称/usr/share/glib-2.0/schemas/99_default_font_settings.gschema.override文件创建一个覆盖文件,并填写以下内容

Ubuntu与Unity

 [org.gnome.desktop.interface] font-name="Ubuntu 11" monospace-font-name="Ubuntu Mono 13" [org.gnome.desktop.wm.preferences] titlebar-font='Ubuntu Bold 11' 

Ubuntu与GNOME3

 [org.gnome.desktop.interface] font-name="Cantarell 11" monospace-font-name="Ubuntu Mono 13" [org.gnome.desktop.wm.preferences] titlebar-font='Cantarell Bold 11' 

Ubuntu MATE

 [org.gnome.desktop.interface] document-font-name='Ubuntu 11' font-name='Ubuntu 11' monospace-font-name='Ubuntu Mono 13' [org.gnome.desktop.wm.preferences] titlebar-font='Ubuntu Bold 11' 

保存文件后,使用此命令编译模式

 sudo glib-compile-schemas /usr/share/glib-2.0/schemas 

然后,可以使用上述任何方法重置为您设置的默认值。

或者,如果您已经在Ubuntu上安装了GNOME环境,请删除ubuntu-gnome-default-settings包以获取ubuntu默认值。 MATE的包是ubuntu-mate-default-settings 。 如果您碰巧将Ubuntu GNOME作为默认设置并安装了ubuntu unity,请删除ubuntu-settings包。

希望这在某种程度上会有所帮助。