Wait what? How does this work?
On OSX:
pmset -g rawlog
Output:
$ pmset -g rawlog pmset is in RAW logging mode now. Hit ctrl-c to exit. * Battery matched at registry = XXXX 01/15/20 XX:XX:XX No AC; Not Charging; 75%; Cap=5490: FCC=XXXX; Design=XXXX; Time=X:XX; -752mA; Cycles=14/1000; Location=XX; Polled boot=01/15/20 XX:XX:XX; Full=01/15/20 XX:XX:XX; User visible=01/15/20 XX:XX:XX
I expect there are more elegant solutions, but this would theoretically work, as I used to use this among other things to track my daily laptop usage to see how on task I was any given day. If the lid is closed but unplugged then I was probably going to/in a meeting, if the lid is closed and charging then I was likely afk, not working. Worked pretty well to give me a ballpark of my productivity.