如何在 Ubuntu 14.04 中为工具栏使用 22 像素大小的图标

PJ *_*ngh 1 icons gedit icon-themes 14.04

有没有办法告诉主题引擎为工具栏使用 22 像素大小的图标?

我喜欢在Ubuntu 中使用 FS 图标集 ( http://franksouza183.deviantart.com/art/FS-Icons-Ubuntu-288407674 )。但是,在 Ubuntu 14.04 中,Gedit(也许还有其他一些程序)现在使用 24 像素大小的图标。gedit 工具栏需要 24 像素大小的图标,但 FS Icon 集有 22 像素图标,下一个更大的尺寸是 32 像素图标。

结果,可用的图标被缩放以适应 gedit 工具栏,“后备”图标用于任何缺失的东西。正如您在下面的屏幕截图中看到的那样,gedit 图标在 Ubuntu 14.04 下看起来很模糊。此外,缺少“打开”、“搜索”和“搜索和替换”工具的单色图标,因此使用不协调的彩色图标代替。

Ubuntu 14.04 中的 Gedit 模糊且缺少 Mono-Dark FS 图标

PJ *_*ngh 5

解决方案是将 22 像素 FS 图标用作 24 像素图标。这是通过创建指向 22 像素图标的链接并更新 FS Icon 主题配置文件来完成的。

1)如果您需要以 root 身份更改 FS Icons 安装,请执行以下命令...

$ sudo -i
Run Code Online (Sandbox Code Playgroud)

2)更改到您安装 FS 图标的位置(例如 /usr/share/icons/)...

$ cd <location where fs icons are installed>
Run Code Online (Sandbox Code Playgroud)

3)对于 24 px 大小的图标,链接到现有的 22 px 大小图标...

$ for file in `ls ./ | grep fs-icons-ubuntu`; do ln -s 22x22 ./$file/24x24; done
Run Code Online (Sandbox Code Playgroud)

4)在 index.theme 中,将 24 px 大小的图标添加到可用的桌面、工具栏、主工具栏、小、面板和对话框大小...

$ sed -i "s|22,|22,24,|g" ./fs-icons-ubuntu*/index.theme
Run Code Online (Sandbox Code Playgroud)

5)在 index.theme 中,添加 24 px 大小的图标目录...

$ sed -i "s|22x22/status,|22x22/status,24x24/actions,24x24/animations,24x24/apps,24x24/categories,24x24/devices,24x24/emblems,24x24/mimetypes,24x24/places,24x24/status,|g" ./fs-icons-ubuntu*/index.theme
Run Code Online (Sandbox Code Playgroud)

6)在 index.theme 中,为动作、动画、应用程序、类别、设备、标志、mimetypes、地点、状态添加 24 像素大小的图标元数据...

$ sed -i "s|\[32x32/actions\]|\n[24x24/actions]\nSize=24\nContext=Actions\nType=Threshold\n\n[24x24/animations]\nSize=24\nContext=Animations\nType=Threshold\n\n[24x24/apps]\nSize=24\nContext=Applications\nType=Threshold\n\n[24x24/categories]\nSize=24\nContext=Categories\nType=Threshold\n\n[24x24/devices]\nSize=24\nContext=Devices\nType=Threshold\n\n[24x24/emblems]\nSize=24\nContext=Emblems\nType=Threshold\n\n[24x24/mimetypes]\nSize=24\nContext=MimeTypes\nType=Threshold\n\n[24x24/places]\nSize=24\nContext=Places\nType=Threshold\n\n[24x24/status]\nSize=24\nContext=Status\nType=Threshold\n\n\n\n[32x32/actions]|g" ./fs-icons-ubuntu*/index.theme
Run Code Online (Sandbox Code Playgroud)

7)更新图标缓存。(您可以忽略“生成的缓存无效”警告)。

$ for file in `ls ./ | grep fs-icons-ubuntu`; do echo "Updating cache for $file..."; gtk-update-icon-cache -f ./$file; done
Run Code Online (Sandbox Code Playgroud)

8)仅当您在上面的步骤 1 中执行了“sudo -i”时才执行以下操作。

$ exit
Run Code Online (Sandbox Code Playgroud)

这是带有更正图标的 gedit 窗口的样子。请注意,图标很清晰,并且工具栏中仅使用了单色图标。

Ubuntu 14.04 中的 Gedit 带有 Sharp Mono-Dark FS 图标

最后,这是使用 FS 图标(特别是“fs-icons-ubuntu-mono-dark”图标)的 Ubuntu 14.04 桌面。

使用 FS Mono Dark Icons 的 Ubuntu 14.04 桌面