[英]Enabling Yosemite's Dark mode through Terminal or Applescript OSX 10.1
有沒有辦法通過Shell腳本(終端)或Applescript打開Yosemite的黑暗模式? 我努力了:
sudo defaults write /Library/Preferences/.GlobalPreferences AppleInterfaceTheme Dark
但它不起作用。
請幫忙!
我為這個目的制作了一個命令行應用程序: dark-mode
。
我想到了。
我在Applescript中這樣做了:
do shell script ("sudo defaults write /Library/Preferences/.GlobalPreferences.plist _HIEnableThemeSwitchHotKey -bool true") with administrator privileges
tell application "Finder" to activate
delay 0.2
tell application "System Events"
key code "17" using {option down, control down, command down} #Option+Control+Command+T
end tell
我不完全確定,但你可能需要重新啟動一些服務來刷新它:
sudo killall Dock; killall SystemUIServer; killall Finder; killall cfprefsd
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.