obbattery.sh 346 B

1234567
  1. Battery=$(acpi -b | grep "Battery" | sed -nr '/Battery/s/.*(\<[[:digit:]]+%).*/\1/p')
  2. Thermal=$(acpi -t | grep "Thermal" | sed -nr "s/.*(\<[[:digit:]]+\.[[:digit:]]) degrees.*/\1°C/p" )
  3. echo "<openbox_pipe_menu>"
  4. echo "<item label=\"Batt: $Battery\"/>"
  5. echo "<item label=\"Temp: $Thermal\"/>"
  6. echo "</openbox_pipe_menu>"