sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwmstatus-temperature.c (259B)


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