Commit 3ad8b1a
Eric Bower
·
2026-10-08 13:14:16 -0400 EDT
parent 9feb4e2
chore: highlight bat if less than 20%
2 files changed,
+5,
-2
+4,
-1
| ... | ... | @@ -38,7 +38,10 @@ def get_battery(): | |
| 38 | 38 | if f.read().strip() == "Charging": | |
| 39 | 39 | status = "CHR" | |
| 40 | 40 | ||
| 41 | - | return f"[[bat]]{status} {cap}%" | |
| 41 | + | out = f"[[bat]]{status} {cap}%" | |
| 42 | + | if int(cap) < 20: | |
| 43 | + | return f"{out} ^" | |
| 44 | + | return out | |
| 42 | 45 | except Exception: | |
| 43 | 46 | pass | |
| 44 | 47 |
+1,
-1