覆盖系统偏好设置面板?
有没有办法覆盖/禁用系统首选项窗格?我想将一个应用程序放在一起,该应用程序将禁用或覆盖“节能器”首选项窗格,并将其自己的规则放在适当的位置,以将计算机置于待机状态、关闭显示器或其他各种节能活动。
Is there a way to override / disable a system preference pane? I'm wanting to put an application together that would disable or override the Energy Saver preference pane, and would put it's own rules in place for putting a machine into standby, turning off the monitor, or other various energy saving activities.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Mac OS X 中当然不支持修改内置 PrefPanes 的方法。
如果您想搞乱电源管理,请对 pmset 命令行实用程序(即
man pmset
)进行一些研究。您可以使用 NSTask 围绕 pmset 编写一个包装器,该包装器将允许您以标准 PrefPane 不允许的方式操作 PM 设置。然后,您可以使用自己的自定义 PrefPane 来通过 pmset 操作 PM 设置。There's certainly no supported way to modify the built-in PrefPanes in Mac OS X.
If you want to mess with Power Management, do some research on the pmset command line utility (i.e.
man pmset
). You could write a wrapper around pmset using NSTask that would allow you to manipulate the PM settings in ways that the standard PrefPane doesn't allow. You could then use your own custom PrefPane to manipulate the PM settings using pmset.没有任何受支持的方法可以执行此操作。您可以将现有的 prefpane (
/System/Library/PreferencePanes/EnergySaver.prefPane
) 替换为具有类似功能的预窗格,但这对用户来说非常不利。我建议实施一个具有您想要的功能的新窗格。There isn't any supported way to do this. You could replace the existing prefpane (
/System/Library/PreferencePanes/EnergySaver.prefPane
) with one that has similar functionality but that would be pretty hostile to the user. I'd recommend implementing a new pane with the functionality you want.