Clover脚本不生成nvram.plist导致不能保存亮度
1. in Terminal: sudo nano /etc/save.nvram
Create an empty save.nvram file in the /etc folder.
在终端中输入sudo nano /etc/save.nvram,创建一个空的文件save.nvram在/ect下面
2. in Nano editor I filled the save.nvram file with these commands:
在Nano编辑器中输入下面的命令:
#!/bin/bash
nvram -x -p > "/nvram.plist"
if [[ -f "/nvram.plist" ]]; then
chflags hidden "/nvram.plist"
这是save.nvram文件的内容,它仅仅起到在系统根目录生成nvram.plist并且使之隐藏的作用。
3. save it.
Press Ctrl + X to save, then press Enter/Return to confirm the file name.
按Ctrl+X保存文件,然后按Enter或Return键确认文件名。
4. in Terminal: sudo chmod +x /etc/save.nvram
This makes the file executable.
在终端中输入sudo chmod +x /etc/save.nvram使之成为可执行文件。
5. in Terminal: sudo defaults write com.apple.loginwindow LogoutHook /etc/save.nvram
This writes the newly created command file into loginwindow's LogoutHook. This means our script will run on each logout. So the nvram getting saved on each logout,restart,and shutdown.
继续在终端输入sudo defaults write com.apple.loginwindow LogoutHook /etc/save.nvram,这会将刚才新建的命令行文件写入登陆窗口的 LogoutHook中。这意味着我们的脚本会在每次注销系统时执行,所以nvram.plist会在登出、重启和关机时生成。
6. Done.
Clover will load this nvram.plist file on startup and will use the saved nvram values.
完成。Clover会在开机的时候自动加载nvram.plist,并且使用保存的nvram值。
fi