当我以 root 身份运行程序时,如何获得匹配的主题?

NES*_*NES 6 themes gtk

我在 Ubuntu 安装中使用了 Metacity 主题。不幸的是,对于以 root 用户身份启动的带有 GUI 的程序和其他一些特定程序(如gufw. 当我gufw使用命令行而不是 root 启动时,它使用了一个旧的、不是很吸引人的主题。

例如,gufw从命令行给出以下输出:

/usr/share/themes/Finery/gtk-2.0/gtkrc:365: error: unexpected number `0', expected number (float)
/usr/share/themes/Finery/gtk-2.0/gtkrc:365: error: unexpected number `0', expected number (float)
Run Code Online (Sandbox Code Playgroud)

这个问题的原因是什么?有没有办法为这些其他程序启用这个主题?

Flo*_*nle 12

您通过 GNOME Appearance Settings 安装的主题位于 ~/.themes - 您自己的主目录,root 不会在其中查找它们。您会注意到系统范围内安装的主题(如 ambiance/radiance)工作正常,因为这些主题位于 /usr/share/themes

要解决此问题,请打开您的终端并输入

sudo ln -s ~/.themes /root/.themes
Run Code Online (Sandbox Code Playgroud)

这样,root 和您的普通用户将共享主题目录,一切看起来都一样。