projects
/
dwm-status
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Close fd if there was an empty return.
[dwm-status]
/
dwmstatus-temperature.c
/*
* gettemperature("/sys/class/hwmon/hwmon0/device", "temp1_input");
*/
char
*
gettemperature
(
char
*
base
,
char
*
sensor
)
{
char
*
co
;
co
=
readfile
(
base
,
sensor
);
if
(
co
==
NULL
)
return
smprintf
(
""
);
return
smprintf
(
"%02.0f°C"
,
atof
(
co
) /
1000
);
}