macos 在 Mac OS X 中修改窗口按钮颜色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8170717/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Modifying Window Button Colors in Mac OS X
提问by Tony
How can I modify the red/yellow/green window buttons for close/minimize/zoom in Mac OS X? There must be an editable resource or plist somewhere.
如何在 Mac OS X 中修改用于关闭/最小化/缩放的红色/黄色/绿色窗口按钮?某处必须有可编辑的资源或 plist。
Here are the buttons I'm talking about:
这是我正在谈论的按钮:
For red/green colorblind individuals, those colors can be maddening. I wish they chose the actual bluish shade of green used in a traffic light instead of the puke grass green. That grassy green is indeterminable from the red.
对于红色/绿色色盲的人来说,这些颜色可能会让人抓狂。我希望他们选择交通灯中使用的实际蓝色阴影而不是呕吐草绿色。那草绿色与红色分不开。
Changing the theme to graphite is a poor alternative, so any other method is much preferred.
将主题更改为石墨是一个糟糕的选择,因此任何其他方法都是更可取的。
回答by Tony
Okay, after a long and seemingly endless research cycle, I've located where the window buttons are stored. They're in a file called ArtFile.bin
in /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/Resources/
.
好的,经过漫长而看似无穷无尽的研究周期,我找到了存储窗口按钮的位置。他们是在一个名为文件ArtFile.bin
中/System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/Resources/
。
Also, a guy named Alex Zielenskiwith the help of Indragie Karunaratnecreated a utility named artFileToolto get to its contents. The second link is the code repository for the utility.
此外,一个名叫Alex Zielenski的人在Indragie Karunaratne的帮助下创建了一个名为artFileTool的实用程序来获取其内容。第二个链接是该实用程序的代码存储库。
Here's the processto extract and then rebuild the resource as described on the MacThemes forum by a user named toutheme:
以下是提取并重建资源的过程,如 MacThemes 论坛上名为toutheme的用户所述:
For ArtFile.bin - Lion
Preparation
- Create new folder: TheFolder
- Copy the Lion ArtFile.bin (/System/Library/PrivateFrameworks/CoreUI.framework/Resources) and artFileTool on TheFolder.
Terminal
- Launch Terminal, type "cd" + "space" + (drag TheFolder on Terminal window). Type enter.
Decoding
To decode ArtFile.bin and compile a folder Resources Disconnected Classified:
./artFileTool -d ArtFile.bin ResourcesDisconnectedClassified
-- or --
To decode ArtFile.bin and compile a folder Named Connected Images:
- ./artFileTool -d -c ArtFile.bin NamedConnectedImages
Edition
Edit your files with PhotoShop, for example…
Encoding
To re-encode the Resources Disconnected Classified:
./artFileTool -e ResourcesDisconnectedClassified ArtFile.bin ArtFile.new.bin
-- or --
To re-encode the Named Connected Images:
- ./artFileTool -e -c NamedConnectedImages ArtFile.bin ArtFile.new.bin
For ArtFile.bin - Snow Leopard:
- ./artFileTool -d -l ArtFile.bin ResourcesDisconnectedClassified
- ./artFileTool -d -l -c ArtFile.bin NamedConnectedImages
- ./artFileTool -e -l ResourcesDisconnectedClassified ArtFile.bin ArtFile.new.bin
- ./artFileTool -e -l -c NamedConnectedImages ArtFile.bin ArtFile.new.bin
For ArtFile200.bin (Lion only):
- Create new folder: TheFolder
- Copy the Lion ArtFile200.bin (/System/Library/PrivateFrameworks/CoreUI.framework/Resources) and artFileTool on TheFolder.
- Launch Terminal, type "cd" + "space" + (drag TheFolder on Terminal window). Type enter.
Decoding
- ./artFileTool -d ArtFile200.bin ResourcesDisconnectedClassified
- ./artFileTool -d -c ArtFile200.bin NamedConnectedImages
Encoding
- ./artFileTool -e ResourcesDisconnectedClassified ArtFile200.bin ArtFile200.new.bin
./artFileTool -e -c NamedConnectedImages ArtFile200.bin ArtFile200.new.bin
Make sure to check the size of the newly created file. (4.0-5.2 mb)
- Rename ArtFile.new.bin to ArtFile.bin and replace the one location in the CoreUI.framework directory
- Logout
对于 ArtFile.bin - Lion
准备
- 创建新文件夹:TheFolder
- 复制 TheFolder 上的 Lion ArtFile.bin (/System/Library/PrivateFrameworks/CoreUI.framework/Resources) 和 artFileTool。
终端
- 启动终端,输入“cd”+“space”+(在终端窗口中拖动 TheFolder)。输入。
解码
解码 ArtFile.bin 并编译文件夹 Resources Disconnected Classified:
./artFileTool -d ArtFile.bin ResourcesDisconnectedClassified
- 或者 -
解码 ArtFile.bin 并编译名为 Connected Images 的文件夹:
- ./artFileTool -d -c ArtFile.bin NamedConnectedImages
版
例如,使用 PhotoShop 编辑您的文件...
编码
重新编码资源断开分类:
./artFileTool -e ResourcesDisconnectedClassified ArtFile.bin ArtFile.new.bin
- 或者 -
要重新编码命名的连接图像:
- ./artFileTool -e -c NamedConnectedImages ArtFile.bin ArtFile.new.bin
对于 ArtFile.bin - 雪豹:
- ./artFileTool -d -l ArtFile.bin ResourcesDisconnectedClassified
- ./artFileTool -d -l -c ArtFile.bin NamedConnectedImages
- ./artFileTool -e -l ResourcesDisconnectedClassified ArtFile.bin ArtFile.new.bin
- ./artFileTool -e -l -c NamedConnectedImages ArtFile.bin ArtFile.new.bin
对于 ArtFile200.bin(仅限 Lion):
- 创建新文件夹:TheFolder
- 复制 TheFolder 上的 Lion ArtFile200.bin (/System/Library/PrivateFrameworks/CoreUI.framework/Resources) 和 artFileTool。
- 启动终端,输入“cd”+“space”+(在终端窗口中拖动 TheFolder)。输入。
解码
- ./artFileTool -d ArtFile200.bin ResourcesDisconnectedClassified
- ./artFileTool -d -c ArtFile200.bin NamedConnectedImages
编码
- ./artFileTool -e ResourcesDisconnectedClassified ArtFile200.bin ArtFile200.new.bin
./artFileTool -e -c NamedConnectedImages ArtFile200.bin ArtFile200.new.bin
确保检查新创建的文件的大小。(4.0-5.2 mb)
- 将 ArtFile.new.bin 重命名为 ArtFile.bin 并替换 CoreUI.framework 目录中的一个位置
- 登出
I hope this helps anyone who got as frustrated as I did at how difficult it is discovering basic information about the inner workings of OS X.
我希望这能帮助那些和我一样感到沮丧的人,因为发现有关 OS X 内部工作的基本信息是多么困难。
回答by clemsam lang
Modifying buttons in MacOSX 10.11 El Capitan can also be done by an Alex Zielenski's tool called "ThemeEngine", found HEREat github.com. You have to edit copies of the
在MacOSX的10.11修改按钮埃尔卡皮坦也可以由亚历克斯Zielenski的工具,称为“ThemeEngine”,做到发现这里在github.com。您必须编辑副本
“.car” files in: /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources
“.car”文件位于:/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources
Each of these .car files contains "WindowFrame_WindowControlButtons" which itself consists of 240 items (!). I "grouped" those (= button in app window) with first "Size" then "Scale". Higher resolved "[email protected]" items are used for Retina Displays, "small" ones for in-app windows, like the colors palette in TextEdit.
这些 .car 文件中的每一个都包含“WindowFrame_WindowControlButtons”,它本身包含 240 个项目(!)。我将那些(= 应用程序窗口中的按钮)“分组”,首先是“大小”,然后是“缩放”。分辨率更高的“[email protected]”项目用于 Retina 显示器,“小”项目用于应用程序内窗口,例如 TextEdit 中的调色板。
In ThemeEngine graphic items (*.psd!) are selected and sent/received to/from a compatible Editor (eg: Photoshop), but can also be individually dragged to any folder, changed or replaced by other apps (even "Preview") and be re-dragged to any .car-file window in ThemeEngine.
在 ThemeEngine 中,图形项目 (*.psd!) 被选择并发送/接收到/从兼容的编辑器(例如:Photoshop),但也可以单独拖动到任何文件夹,更改或替换为其他应用程序(甚至“预览”)并重新拖动到 ThemeEngine 中的任何 .car-file 窗口。
Normally you'd first have to deactivate SIP in El Capitan, but I found it easier to select my "old" Maverick USB drive as startup disk and drag the SystemAppearance.car back into SystemAppearance.bundle manually, then to re-restart (see also "AccessibilityDarkAppearance.car").
通常,您首先必须在 El Capitan 中停用 SIP,但我发现选择我的“旧”Maverick USB 驱动器作为启动盘并手动将 SystemAppearance.car 拖回 SystemAppearance.bundle,然后重新启动更容易(请参阅还有“AccessibilityDarkAppearance.car”)。
I find the new disgustingly-2D icons really amateurish, kind of "deflated" -- so I exchanged them with a set of Maverick-like ones, copied from an older MacOSX. As a compromise I applied the "negative" white plus/minus signs used in El-Capitan.
我发现新的令人厌恶的 2D 图标真的很业余,有点“泄气”——所以我用一组从旧 MacOSX 复制的类似 Maverick 的图标交换了它们。作为妥协,我应用了 El-Capitan 中使用的“负”白色加号/减号。
(Btw: I didn't use the above mentioned artFileTool by Alex to get at the Aqua buttons, but simply made a series of screenshots and cut out the various states of round Aqua buttons.)
(顺便说一句:我没有使用 Alex 上面提到的 artFileTool 来获取 Aqua 按钮,而是简单地制作了一系列屏幕截图并剪掉了圆形 Aqua 按钮的各种状态。)
If anybody is interested I can post my "SystemAppearance.car" file here ...
如果有人感兴趣,我可以在这里发布我的“SystemAppearance.car”文件......
回答by Mitchell Model
Just as a reminder, the Graphite appearance in Snow Leopard and earlier changed the window buttons to gray. I was quite surprised and unhappy that in Mountain Lion these remain colored even in the Graphite theme. (I forget what Lion did, because I only used it briefly.) It's my machine. I want to change it. Color stands out more than I want and is distracting. It also looks unprofessional. In fact, I used to use Unsanity's Mighty Mouse to turn the stupid colored beachball into something gray.
提醒一下,Snow Leopard 和更早版本中的 Graphite 外观将窗口按钮更改为灰色。我很惊讶也很不高兴,即使在 Graphite 主题中,Mountain Lion 中的这些仍然是彩色的。(我忘记了 Lion 做了什么,因为我只是简单地使用过它。)这是我的机器。我想改变它。颜色比我想要的更突出,而且会分散注意力。看起来也很不专业。事实上,我曾经使用 Unsanity 的 Mighty Mouse 将愚蠢的彩色沙滩球变成灰色的东西。