DWM Status Bar
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
259 B

7 years ago
  1. /*
  2. * gettemperature("/sys/class/hwmon/hwmon0/device", "temp1_input");
  3. */
  4. char *
  5. gettemperature(char *base, char *sensor)
  6. {
  7. char *co;
  8. co = readfile(base, sensor);
  9. if (co == NULL)
  10. return smprintf("");
  11. return smprintf("%02.0f°C", atof(co) / 1000);
  12. }