Visualizzare lo stato della batteria da terminale in Linux

Mattepuffo's logo
Visualizzare lo stato della batteria da terminale in Linux

Visualizzare lo stato della batteria da terminale in Linux

Ho trovato due programmi distinti che ci permettono di controllare lo stato della batteria in Linux:

  • acpi
  • upower

Sulla mia Debian 11 con XFCE il secondo era già installato.

Ma se vogliamo essere sicuri:

# aptitude install upower acpi

Vediamo un esempio per ciascuno partendo da acpi:

$ acpi -V
Battery 0: Discharging, 42%, 02:16:14 remaining
Battery 0: design capacity 6666 mAh, last full capacity 5104 mAh = 76%
Adapter 0: off-line
Thermal 0: ok, 29.8 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 119.0 degrees C
Thermal 1: ok, 27.8 degrees C
Thermal 1: trip point 0 switches to mode critical at temperature 119.0 degrees C
Thermal 1: trip point 1 switches to mode active at temperature 71.0 degrees C
Thermal 1: trip point 2 switches to mode active at temperature 55.0 degrees C
Thermal 1: trip point 3 switches to mode active at temperature 50.0 degrees C
Thermal 1: trip point 4 switches to mode active at temperature 45.0 degrees C
Cooling 0: Processor 0 of 3
Cooling 1: SEN2 no state information available
Cooling 2: Processor 0 of 3
Cooling 3: B0D4 no state information available
Cooling 4: Processor 0 of 3
Cooling 5: iwlwifi_1 no state information available
Cooling 6: Fan 0 of 1
Cooling 7: Fan 0 of 1
Cooling 8: Processor 0 of 3
Cooling 9: Fan 0 of 1
Cooling 10: Processor 0 of 3
Cooling 11: SEN1 no state information available
Cooling 12: Processor 0 of 3
Cooling 13: pch_skylake no state information available
Cooling 14: Processor 0 of 3
Cooling 15: x86_pkg_temp no state information available
Cooling 16: Fan 0 of 1
Cooling 17: Fan 0 of 1
Cooling 18: Processor 0 of 3
Cooling 19: INT3400 Thermal no state information available
Cooling 20: intel_powerclamp no state information available

Con l'opzione -V gli ho indicato di visualizzare tutto.

Invece upower funziona in maniera un pò diversa:

$ upower -i `upower -e | grep 'BAT'`
  native-path:          BAT0
  vendor:               SDI
  model:                Dell
  serial:               50301
  power supply:         yes
  updated:              mer 27 ott 2021, 15:57:38 (107 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              23,6763 Wh
    energy-empty:        0 Wh
    energy-full:         56,6544 Wh
    energy-full-design:  73,9926 Wh
    energy-rate:         9,9234 W
    voltage:             11,204 V
    time to empty:       2,4 hours
    percentage:          41%
    capacity:            76,5677%
    technology:          lithium-ion
    icon-name:          'battery-good-symbolic'
  History (charge):
    1635343058	41,000	discharging
  History (rate):
    1635343058	9,923	discharging

Enjoy!


Condividi

Commentami!