This is a collection of provisioning scripts I cobbled together for my Early 2015 13" Retina Macbook Pro, which, after having faithfully served me for more than I expected as my daily driver, has now taken on a new assignment as a home server.
The scripts deal with little annoying things, like not being able to keep the machine awake with the lid closed by default, or they install things like Thunderbolt drivers so one can use the Gigabit Ethernet adapter properly.
The scripts were written on, and were only tested for the model mentioned above, the MacbookPro 12,1 / A1502 model. I don't expect there should be any difficulty in getting it to work on any other models; as long as devices names like LID0
and intel_backlight
remained the same. If not, these should be really easy to adjust.
Run these in the following order for sanity's sake. Scripts marked with 🥪 should be run with root
privileges (like, sudo
).
- 🥪
disable_lid_sleep.sh
to disable lid sleep function create_aliases.sh
to create some fun aliases- 🥪
setup_brightness.sh
to create the scripts that will turn the monitor on and off and enableturnscreen
alias - 🥪
setup_lid_monitor.sh
to create the service to turn off screen brightness when the lid is closed
That's it.
Some scripts should be generated in ~/.mbp-scripts
that enable the following.
- Your laptop will not switch off when you close the lid through tweaks to
/etc/systemd/logind.conf
- You will be able to issue
turnscreen on
orturnscreen off
commands through analias
created in.bashrc
for~/.mbp-scripts/turnscreen.sh
- You will be able to remain polite to your computer and say
please
forsudo
through adding analias
to your.bashrc
file - The screen backlight will be switched on/off whenever you open/shut the laptop lid through installing
"~/.mbp-scripts/lid_monitor.sh"
aslid_monitor.service