Capitan中以编程方式

Capitan中以编程方式

本文介绍了在El Capitan中以编程方式“自动隐藏菜单栏"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢 El Capitan 中的自动隐藏菜单栏"选项,但有时我喜欢它(私人)有时我不喜欢(工作).有没有一种方法可以通过更改plist文件中的值来以编程方式显示/隐藏它?如果是这样,该设置是在哪个 plist 文件中找到的?感谢您的帮助.

I really love the 'auto hide menubar' option in El Capitan, but sometimes I like it (private) sometimes I don't (work). Is there a way to show/hide it programmatically by changed it's value in a plist file? If so, in which plist file is that setting found? Any help is appreciated.

推荐答案

以下是使用默认设置隐藏和取消隐藏菜单栏的方法:

Here's how you can set the menubar to be hidden and unhidden using defaults:

隐藏:

defaults write NSGlobalDomain _HIHideMenuBar -bool true

显示:

defaults write NSGlobalDomain _HIHideMenuBar -bool false

运行后,注销并重新登录.或者,您可以以登录用户身份运行以下命令以重新启动Finder并显示更改:

Once run, logout and log back in. Alternatively, you can run the following command as the logged-in user to restart Finder and show the changes:

killall Finder

MacOs Sierra

正如 trevordmiller 在下面的评论中指出的那样,在 Sierra 中,您似乎必须先关闭终端才能使更改生效.

MacOs Sierra

As trevordmiller points out in the comment below, in Sierra it seems you have to close your terminal first to make the change have any effect.

这篇关于在El Capitan中以编程方式“自动隐藏菜单栏"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 05:37