如何访问 Ubuntu 18.04 上的 ubuntu.css 文件中引用的 /org/gnome/shell/theme/?

UnK*_*OWn 7 gnome-shell

有没有办法///org/gnome/shell/theme/在 Ubuntu 18.04 中访问?
我在一个.css文件中得到了这个路径/usr/share/gnome-shell/theme/ubuntu.css

例如:

resource:///org/gnome/shell/theme/checkbox-off.svg  
resource:///org/gnome/shell/theme/toggle-on-us.svg
Run Code Online (Sandbox Code Playgroud)

例子:

.check-box StBin {
  width: 24px;
  height: 22px;
  background-image: url("resource:///org/gnome/shell/theme/checkbox-off.svg"); }


.check-box:checked StBin {
  background-image: url("resource:///org/gnome/shell/theme/checkbox.svg"); }
Run Code Online (Sandbox Code Playgroud)

pom*_*sky 7

/org/gnome/shell/theme/不是一个实际的目录,你可以访问(你不能访问它使用dconf编辑器无论是)。这与 GResource 机制相关联,GNOME shell 可以从resource://URI 中获取资源。通常它们不是人类可读的,因为它们被预编译为二进制格式。

但是,您可以使用该gresource命令提取资源。您应该能够.gresource/usr/share/gnome-shell/shell 主题的目录中的某处找到一个文件。首先通过运行检查它是否包含您正在寻找的资源

gresource list /path/to/filename.gresource | grep <resource-name>
Run Code Online (Sandbox Code Playgroud)

例如,

gresource list /path/to/filename.gresource | grep checkbox-off.svg
Run Code Online (Sandbox Code Playgroud)

确认后,运行以下命令提取资源

gresource extract /path/to/filename.gresource /path/to/resource
Run Code Online (Sandbox Code Playgroud)

例如,

gresource extract /path/to/filename.gresource /org/gnome/shell/theme/checkbox-off.svg
Run Code Online (Sandbox Code Playgroud)

它应该显示.svg文件的内容。

您可以使用此资源而无需.css为您的自定义主题提取文件,如下所示

url("resource:///path/to/resource");
Run Code Online (Sandbox Code Playgroud)

例如,

url("resource:///org/gnome/shell/theme/checkbox-off.svg");
Run Code Online (Sandbox Code Playgroud)