tbatt.c: hide status when battery is absent - spoon - [fork] customized build of spoon, the dwm status utility
 (HTM) git clone git://src.adamsgaard.dk/spoon
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 427131eb1a991075c267188bddf570ea742df500
 (DIR) parent 5b2da9712846e6b4b59992ca636ce0e612c76924
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Wed,  6 Jan 2021 19:00:15 +0100
       
       batt.c: hide status when battery is absent
       
       Diffstat:
         M batt.c                              |       4 +---
       
       1 file changed, 1 insertion(+), 3 deletions(-)
       ---
 (DIR) diff --git a/batt.c b/batt.c
       t@@ -50,9 +50,7 @@ battread(void *arg, char *buf, size_t len)
                }
                close(fd);
        
       -        if (info.battery_state == APM_BATTERY_ABSENT)
       -                snprintf(buf, len, "[no batt]");
       -        else
       +        if (info.battery_state != APM_BATTERY_ABSENT)
                        battprint(buf, len, info.ac_state == APM_AC_ON,
                                  info.battery_life, info.minutes_left);
                return 0;