<p>This is a story of a laptop with two power problems.</p>
<p>The first and less severe is that sometimes the charging of the battery will get stuck at a certain percentage. This is not simply due to the effect commonly found with aging batteries but a fault with the laptop's charging hardware. A full reset of the charging system can fix it, which for this ASUS Zenbook UX550vd laptop requires a long press &#x2014; meaning 40 seconds &#x2014; from its shutdown state.</p>
<p>The second and more serious issue is that the laptop thinks that it is plugged into AC power even when it is running only on battery. I ruled out an operating system or software issue because the issue remains whether running GNU/linux or Windows. The problem is serious because the power management software, in my case in KDE, will not respond to critically low battery levels by suspending or gracefully shutting down. It may be that a sudden loss of power damaged the previous SSD in this laptop, which was the subject of <a href="https://hackerpublicradio.org/eps.php?id=3428">HPR 3428</a>.</p>
<p>My first attempt to fool KDE into seeing accurate battery information under <code>/sys/class/power_supply/BAT0</code> using an overlay filesystem failed presumably because KDE's power system is listening out for some kind of event rather than simply monitoring those files. My second and successful attempt involved writing my own bash scripts run by cron to monitor battery levels and initiate actions when they got too low. There were errors with comedic consequences along the way. In fact, while writing these shownotes after I finished recording the audio, the laptop suspended itself because of a bug in my script - I used <code>le</code> (less than or equal to) rather than <code>lt</code> (less than) in my test for a change in the battery charge leading to unintended and fun consequences when the battery was fully charged.</p>
