On Arch Linux on my laptop, I have acpid control the brightness level based on AC plug events. Plugging in gives me max brightness and running on battery sets it at the minimum.
My problem is that when I start the laptop, the brightness is always at the highest. That is, there isn't anything to trigger the brightness change, so it runs with the highest brightness.
How can I make it so that the brightness will set correctly on startup? I was thinking of creating a systemd service as a potential solution, but I have never written one before and I wanted to hold out for any alternative (potentially better) methods before I start.
UPDATE: I ended up using a udev rule, I was unaware of its ability to control things like brightness. I still have to keep acpid, however, since udev is apparently unable to pick up my laptop close event.
Anyway, here is the link to the rule I found: https://github.com/Unia/powersave/blob/master/rules/50-powersave.rules