helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
808 stars 58 forks source link

Make Power Management work on MacBooks and make it configurable #73

Open probonopd opened 3 years ago

probonopd commented 3 years ago

Power Management: Something should happen on closing the lid on a MacBook Pro. At the very least, the screen should be switched off.

https://wiki.freebsd.org/SuspendResume says

For the lid to operate suspend/resume set: sysctl hw.acpi.lid_switch_state=S3

We probably need to make Power Saving opt-in and configurable in a preferences application.

https://forums.freebsd.org/threads/how-to-make-the-laptop-sleep-when-lid-is-closed.6942/#post-40692 says

Just set # sysctl hw.acpi.lid_switch_state=S3 if you know that ACPI state S3 (Suspend) works for you.

Could we get the information whether ACPI state S3 (Suspend) works for a particular machine from @linuxhw?

probonopd commented 3 years ago

Also see the section on ACPI:

https://vermaden.wordpress.com/tag/x11/

probonopd commented 3 years ago

This information may be useful for the upcoming GUI:

# sysctl -a | grep hw.acpi
hw.acpi.supported_sleep_state: S3 S4 S5
hw.acpi.power_button_state: S5         
hw.acpi.sleep_button_state: S3         
hw.acpi.lid_switch_state: S3           
hw.acpi.standby_state: NONE            
hw.acpi.suspend_state: S3              
hw.acpi.sleep_delay: 1                 
hw.acpi.s4bios: 0                      
hw.acpi.verbose: 0                     
hw.acpi.disable_on_reboot: 0           
hw.acpi.handle_reboot: 0               
hw.acpi.reset_video: 0                 
hw.acpi.video.crt0.active: 0           
hw.acpi.video.tv0.active: 0            
hw.acpi.video.ext0.active: 0           
hw.acpi.video.lcd0.active: 1           
hw.acpi.video.lcd0.brightness: 100     
hw.acpi.video.lcd0.fullpower: 100      
hw.acpi.video.lcd0.economy: 80         
hw.acpi.video.lcd0.levels: 100 80 0 10 20 30 40 50 60 70 80 90 100
hw.acpi.video.out0.active: 0                                      
hw.acpi.video.out1.active: 0                                      
hw.acpi.thermal.min_runtime: 0                                    
hw.acpi.thermal.polling_rate: 10
hw.acpi.thermal.user_override: 0
hw.acpi.thermal.tz0.temperature: 57.0C
hw.acpi.thermal.tz0.active: -1
hw.acpi.thermal.tz0.passive_cooling: 0
hw.acpi.thermal.tz0.thermal_flags: 0
hw.acpi.thermal.tz0._PSV: -1
hw.acpi.thermal.tz0._HOT: -1
hw.acpi.thermal.tz0._CRT: 102.0C
hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
hw.acpi.thermal.tz0._TC1: -1
hw.acpi.thermal.tz0._TC2: -1
hw.acpi.thermal.tz0._TSP: 300
hw.acpi.battery.life: 100
hw.acpi.battery.time: -1
hw.acpi.battery.state: 0
hw.acpi.battery.units: 1
hw.acpi.battery.info_expire: 5
hw.acpi.acline: 1
hw.acpi.cpu.cx_lowest: C2
probonopd commented 3 years ago

Just doing sysctl hw.acpi.lid_switch_state=S3 does not lead to reliable action on MacBook10,3.

probonopd commented 3 years ago

Actually it makes it do something, but wakeup is less than ideal.