bclm icon indicating copy to clipboard operation
bclm copied to clipboard

BFCL value does not seem to be restored on reboot

Open godly-devotion opened this issue 3 years ago • 8 comments

Even after setting the bclm utility to launch at login, it doesn't seem to be restoring the BFCL property correctly. The MagSafe charger light is orange and it requires re running the utility to update it again. The BCLM property seems to be fine but that could be because it doesn't reset that value at reboot as easily, which could mean that its not running the command correctly at login.

macOS Mojave 10.14.6 MacBook Pro 13" Early 2015

godly-devotion avatar Dec 19 '20 02:12 godly-devotion

Can you verify that /Library/LaunchDaemons/com.zackelia.bclm.plist has something like this section:

<string>/usr/local/bin/bclm</string>
<string>write</string>
<string>77</string>

And also that the bclm binary referenced there is at least version 0.0.3?

zackelia avatar Dec 20 '20 15:12 zackelia

The LaunchDaemon plist file seems to be correct. For testing purposes, I modified the value from 65 to 60 to see if it would apply the value correctly. However upon logging in again, i checked the BCLM value and it was still set to 65 meaning the value wasn't restored correctly. I've updated the issue title to accurately reflect the problem I am having.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.zackelia.bclm.plist</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/bin/bclm</string>
		<string>write</string>
		<string>60</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>
~ % which bclm
/usr/local/bin/bclm

bclm version is 0.0.4.

godly-devotion avatar Dec 20 '20 16:12 godly-devotion

It sounds like possibly the job is not running on boot? Try sudo launchctl list | grep com.zackelia.bclm.plist and if it is working, it should have a status of 0 indicating it was successful.

zackelia avatar Dec 20 '20 21:12 zackelia

- 0 com.zackelia.bclm.plist so it seems it should've been successful.

godly-devotion avatar Dec 21 '20 00:12 godly-devotion

Was able to replicate this, going to try and work on a fix here soon.

zackelia avatar Dec 24 '20 00:12 zackelia

Still taking a look at this when I can... it appears that the BCLM value is fine but BFCL is getting overwritten some time shortly after the launchd job goes. So far I tried adding a niceness value but that didn't change much, still investigating.

zackelia avatar Jan 13 '21 22:01 zackelia

Also facing this issue on MacBook Pro 15' Late 2013 running macOS Big Sur 11.1 Running the utility again fixes the BFCL value.

amoratti avatar Jan 21 '21 19:01 amoratti

+1, just writing the keys to smc manually, I find that BCLM survives reboots but BFCL does not. I wonder if we can find which process is responsible for resetting this BFCL value.

krackers avatar Dec 22 '21 01:12 krackers