battery icon indicating copy to clipboard operation
battery copied to clipboard

Adds a simplified output mode

Open xxxserxxx opened this issue 2 years ago • 0 comments

I use this in my lock screen script to generate the battery status on my laptop. The original text was TMI (for a lock screen) and required a fair bit of processing to extract only the information I wanted.

This change adds a trivial flag -s which, when provided, prints out only the charge state (using unicode emoji characters) and the % charge.

$ battery
BAT0: Discharging, 47.25%, 2h33m45.7848s remaining [Voltage: 7.53V (design: 7.60V)]
$ battery -s   # Discharging
🔋 47%
$ battery -s   # Empty
🪫 0%
$ battery -s   # Fully
🔋 100%
$ battery -s   # Charging
🔌 49%

xxxserxxx avatar Oct 14 '21 20:10 xxxserxxx