如何使用Human-Clearlooks主题在窗口标题栏中获取正常的Ubuntu橙色?

诺伯特

我已经安装了Ubuntu MATE 18.04 LTS。以前,我在MATE 17.10上遇到了此问题。我喜欢老式的Human-Clearlooks主题,因此我安装了human-theme软件包。

但是它在窗口标题栏中具有奇怪的银色背景色:

Ubuntu 18.04 LTS MATE中不正确的银色

在16.04 LTS中,它具有正常的Ubuntu橙色-请参阅下面的屏幕截图进行比较: 在Ubuntu 16.04 LTS MATE中正确的橙色

我已经向LaunchPad报告了错误1721955,该错误已被其他用户确认。

如何调试该问题?你有什么想法?

如何使基于GTK2的主题在基于GTK3的Ubuntu中再次工作?

Update 20180505: Ubuntu MATE 18.04 LTS is affected too. We have a discussion on ubuntu-mate.community.

Update 20190128: Ubuntu MATE 18.10 and upcoming 19.04 are affected too.

Update 20190131: below are the screenshots from Ubuntu MATE 18.04 LTS using Human theme -

  • Gtk2 demo (named gtk-demo)

    gtk2

  • Gtk3 demo (named gtk3-widget-factory)

    gtk3

both greys are different here. But on Ubuntu 16.04 MATE LTS the Gtk2 window title is orange.

user37165

Human-Clearlooks needs GTK+3 support to be useful.

With some efforts, the legacy theme can be adapted and can be used in newer releases of Ubuntu and the derivatives. The title bar with Human theme however, will only be visible when Metacity window manager is used.

Useless warning: Some window managers may not show the title bar with Human theme at all. For GTK+ desktop environment, if the client-side decoration a.k.a. header bars in GNOME is used by default, user might want to disable that and replace with title bar for desired appearance. Hence this useless warning or the warning of becoming useless (pun included).

The following instructions will assume that:

  • user has installed the required packages from the Universe repository: human-theme and exactly mate-themes and prefer to do either;
  • Setup A (easy): Human-Clearlooks theme with Blue variant or,
  • Setup B: Human-Clearlooks theme with Blue/Orange variant.

The required packages would provide the base theme: TraditionalOk is recommended. More information is found at lower half of this post, under Troubleshooting section.

Setup A (easy)

MATE, like GNOME2, has a native way to easily customize GTK+ theme. User will choose one of available themes and then customize to mix and match with other themes.

Go to Control Center > Appearance - Theme and select the base theme: TraditionalOk. Click Customize... and change the options in respective tab accordingly.

  • Controls: TraditionalOk
  • Window Border: Human (changed from TraditionalOk)
  • Icons: Humanity (changed from MATE)
  • Pointer: MATE

Click Close to finish and user will see a new entry Custom that will appear as the first entry. The changes are applied immediately, but not persistent. To make the changes persistent, select the customized theme and click Save As... and enter Name and Description as desired or accordingly.

  • Name: TraditionalHuman
  • Description: TraditionalOk customized with Human window border and Humanity icons (optional)

Finally click Save and user will see the customized theme is now renamed from Custom to the name of choice. This will automatically create ~/.themes/TraditionalHuman/index.theme for the customized theme.

设置A-具有蓝色变体的清晰人像

As a result, we have recreated Human-Clearlooks theme with Blue variant. The Blue colour comes from the base theme: TraditionalOk, a GTK+3 port of Clearlooks from mate-themes package.

Compatibility: MATE/GNOME2 desktop environment only.

Limitation: Setup A does not provide option to freely change the colour. Customization is limited to the number of available themes to mix and match. Whichever themes that were used should not be removed, otherwise the customized theme will be broken.

Setup B

This setup will use selected parts of available themes to create a new theme: simply named "TraditionalHuman" with minimal dependence on these packages: gtk2-engines, humanity-icon-theme and dmz-cursor-theme. Take note as follows.

  • For Human-Clearlooks with Blue variant (same as Setup A), follow only these steps: 1, 2, Final.
  • For Human-Clearlooks with Orange variant, follow all steps below.

Step 1: Create a local theme directory at ~/.themes and copy the following selective files from the available themes to the local theme directory. Available themes to use: Human, Human-Clearlooks, TraditionalOk.

$ cd $HOME
$ mkdir -p .themes/TraditionalHuman
$ cd .themes/TraditionalHuman
$ cp /usr/share/themes/Human/index.theme .
$ cp /usr/share/themes/Human/cursor.theme .
$ cp -R /usr/share/themes/Human/metacity-1/ .
$ cp -R /usr/share/themes/Human-Clearlooks/gtk-2.0/ .
$ cp -R /usr/share/themes/TraditionalOk/gtk-3.0/ .

Step 2: Edit index.theme file with the following content to define the local theme.

$ nano index.theme
[Desktop Entry]
Type=X-GNOME-Metatheme
Name=TraditionalHuman
Comment=Make TraditionalOk more Human
Encoding=UTF-8

[X-GNOME-Metatheme]
GtkTheme=TraditionalHuman
IconTheme=Humanity
MetacityTheme=TraditionalHuman
CursorTheme=TraditionalHuman

Step 3: Edit the lines containing theme_selected_bg_color and core_color_a and replace the hexadecimal value to #ffbe6b. Precaution: Keep the semicolons ; at the end!

$ nano gtk-3.0/gtk.css
...
@define-color theme_selected_bg_color #ffbe6b;
...
@define-color core_color_a #ffbe6b; /* Core color for blue widgets in TraditionalOk. */
...

Step 4: Edit the line containing selected_bg_color and replace the hexadecimal value to #ffbe6b. Precaution: That is a single long line. Keep the \n instances!

$ nano gtk-3.0/settings.ini
...
gtk-color-scheme = "base_color:#ffffff\nbg_color:#edeceb\nfg_color:#000000\nselected_bg_color:#ffbe6b\nselected_fg_color:#ffffff\ntooltip_bg_color:#f5f5b5\ntooltip_fg_color:#000000\ntext_color:#1a1a1a\nlink_color:#0000ee\nvisited_link_color:#551a8b"
...

Final step: Change the theme and enjoy.

Go to Control Center > Appearance - Theme (or any supported theme manager) and select the created theme "TraditionalHuman". The changes will be applied after several seconds.

设置B-带有橙色款式的人形外观

As a result, we have recreated Human-Clearlooks theme with Orange variant. The Orange colour comes from the hexadecimal value #ffbe6b that is used in the original Human-Clearlooks theme.

Variation: If user wish to have Human theme with both Blue and Orange variants, make sure to give a different name for each variant. That means, user should specify the different names for the created theme directory and every instance of the name used in index.theme file.

For example, I renamed Blue variant as "TraditionalHuman" and Orange variant as "TraditionalHumanMore" that are shown in the screenshot as follows.

设置B-具有蓝色/橙色变体的清晰人类外观

User can also create more variations with different colour likewise.

Compatibility: MATE/GNOME2 and other GTK+ desktop environment.

Limitation: Setup B mostly relies on user initiatives. The theme documentation might be helpful, but rarely found. Customization is either doable or impossible: depends on whether user can understand how the theme files work or otherwise.

Troubleshooting

Additional notes to understand how theme works as follows.

The base theme: This should be the most compatible theme. A common mistake is that user tend to use the legacy theme, which is the least compatible to begin with. Do not use, and I mean do not use Human theme as the base theme (repeated on purpose).

Example of a "wrong" base theme that cannot be customized as expected:

人体主题无法按预期自定义

Colour selection: Check the original theme files to be sure, and do not use colour picker against the apparent colour seen on the desktop. The apparent colour is not the actual colour: Human-Clearlooks uses Ubuntu Orange (#ffbe6b) as the main colour, but the title bar with Human theme does not show this colour itself.

Install directory: The customized theme is installed for current user only at ~/.themes in the Home directory. For system-wide users, install to /usr/share/themes instead. System-wide themes must be installed with proper permission 755, otherwise the theme may appear broken.

Yet unusable: Regardless of setup, use theme files for the same release. Do not mix theme files from different releases, otherwise the result is an unusable theme!

I have at least tested TraditionalOk from mate-themes package on all supported LTS releases at this time. Theme files for the same release will always work. Exceptional case: theme files in 14.04 and 16.04 are fairly backward and forward compatible, with little to no apparent defects.

|      \theme |       TraditionalOk      |
| system\     | 18.04  | 16.04  | 14.04  |
| ----------- | ------ | ------ | ------ |
| 18.04       | OK     | BROKEN | BROKEN |
| 16.04       | BROKEN | OK     | FAIR   |
| 14.04       | BROKEN | FAIR   | OK     |

Example of a "broken" appearance (narrow alignment in menu bar), and also an unsupported window manager with Human theme (only had some hint of Ubuntu Orange):

具有清晰版本和环境的Human-Clearlooks

Other environment: Human-Clearlooks was designed for GNOME2 and Metacity window manager. Cinnamon with Muffin window manager may support the Human theme natively. Other window manager like Xfwm or Openbox might require additional configuration to show the exact appearance. That will be too broad and will not be covered in this answer.

User can hack any theme files; however, be prepared to spend at least few hours or may be several days in test environment. Hacking theme files is usually not worth the time (try again by own... without looking at this answer). Not to mention that GTK+ theme documentation is rarely found.

The most simple solution: use whatever theme that works for newer releases.

TL; DR:使用支持GTK + 3的主题并从中进行定制。除非用户对主题有极大的兴趣,否则不值得查看带有混乱代码的主题文件。我快速浏览并认为易于修复,但花了几天时间才能得到此答案。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何使用Human-Clearlooks主题在窗口标题栏中获取正常的Ubuntu橙色?

来自分类Dev

如何在窗口周围绘制矩形而不覆盖Win32中的标题栏

来自分类Dev

如何在Ubuntu 18.04中将窗口菜单移至窗口标题栏?

来自分类Dev

如何在Ubuntu 18.04中将窗口菜单移至窗口标题栏?

来自分类Dev

如何获取 tkinter 窗口标题栏的高度

来自分类Dev

如何在Windows中获取窗口的默认标题栏高度?

来自分类Dev

如何在Windows 8.1中获取WPF窗口的标题栏颜色?

来自分类Dev

Ubuntu菜单重叠标题栏时如何移动窗口

来自分类Dev

Ubuntu菜单重叠标题栏时如何移动窗口

来自分类Dev

如何在 Ubuntu 18.04 中使窗口的标题栏透明?

来自分类Dev

如何获得NSWindow标题栏的颜色,尤其是在窗口失去焦点时?

来自分类Dev

如何在窗口标题栏上添加选项卡控件

来自分类Dev

如何在Ubuntu gnome上获取Mac样式的标题栏按钮,而无需更改主题的其余部分?

来自分类Dev

如何在Ubuntu gnome上获取Mac样式的标题栏按钮,而无需更改主题的其余部分?

来自分类Dev

如何在 20.04 中隐藏窗口标题栏?

来自分类Dev

在Android中自定义标题栏。获取异常您需要使用Theme.AppCompat主题

来自分类Dev

如何隐藏特定窗口的标题栏?

来自分类Dev

如何隐藏QDialog窗口的标题栏?

来自分类Dev

如何使Xubuntu窗口标题栏透明?

来自分类Dev

如何关闭gnome Shell / Mutter中的窗口标题栏(窗口装饰)?

来自分类Dev

如何关闭gnome Shell / Mutter中的窗口标题栏(窗口装饰)?

来自分类Dev

如何在GTK + 3中设置标题栏关闭按钮的主题?

来自分类Dev

如何在GTK + 3中设置标题栏关闭按钮的主题?

来自分类Dev

如何在不触摸Ubuntu Touch标题栏的情况下移动窗口?

来自分类Dev

Google Chrome浏览器未使用Ubuntu的标题栏和窗口按钮

来自分类Dev

使用Gnome3在Ubuntu中程序没有标题栏和边框是否正常?

来自分类Dev

使用Gnome3在Ubuntu中程序没有标题栏和边框是否正常?

来自分类Dev

如何删除活动中的标题栏?

来自分类Dev

如何设置WPF窗口的宽度等于其标题栏中的内容?

Related 相关文章

  1. 1

    如何使用Human-Clearlooks主题在窗口标题栏中获取正常的Ubuntu橙色?

  2. 2

    如何在窗口周围绘制矩形而不覆盖Win32中的标题栏

  3. 3

    如何在Ubuntu 18.04中将窗口菜单移至窗口标题栏?

  4. 4

    如何在Ubuntu 18.04中将窗口菜单移至窗口标题栏?

  5. 5

    如何获取 tkinter 窗口标题栏的高度

  6. 6

    如何在Windows中获取窗口的默认标题栏高度?

  7. 7

    如何在Windows 8.1中获取WPF窗口的标题栏颜色?

  8. 8

    Ubuntu菜单重叠标题栏时如何移动窗口

  9. 9

    Ubuntu菜单重叠标题栏时如何移动窗口

  10. 10

    如何在 Ubuntu 18.04 中使窗口的标题栏透明?

  11. 11

    如何获得NSWindow标题栏的颜色,尤其是在窗口失去焦点时?

  12. 12

    如何在窗口标题栏上添加选项卡控件

  13. 13

    如何在Ubuntu gnome上获取Mac样式的标题栏按钮,而无需更改主题的其余部分?

  14. 14

    如何在Ubuntu gnome上获取Mac样式的标题栏按钮,而无需更改主题的其余部分?

  15. 15

    如何在 20.04 中隐藏窗口标题栏?

  16. 16

    在Android中自定义标题栏。获取异常您需要使用Theme.AppCompat主题

  17. 17

    如何隐藏特定窗口的标题栏?

  18. 18

    如何隐藏QDialog窗口的标题栏?

  19. 19

    如何使Xubuntu窗口标题栏透明?

  20. 20

    如何关闭gnome Shell / Mutter中的窗口标题栏(窗口装饰)?

  21. 21

    如何关闭gnome Shell / Mutter中的窗口标题栏(窗口装饰)?

  22. 22

    如何在GTK + 3中设置标题栏关闭按钮的主题?

  23. 23

    如何在GTK + 3中设置标题栏关闭按钮的主题?

  24. 24

    如何在不触摸Ubuntu Touch标题栏的情况下移动窗口?

  25. 25

    Google Chrome浏览器未使用Ubuntu的标题栏和窗口按钮

  26. 26

    使用Gnome3在Ubuntu中程序没有标题栏和边框是否正常?

  27. 27

    使用Gnome3在Ubuntu中程序没有标题栏和边框是否正常?

  28. 28

    如何删除活动中的标题栏?

  29. 29

    如何设置WPF窗口的宽度等于其标题栏中的内容?

热门标签

归档