mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 08:34:50 +00:00
53ab1f7d3c
Daemon that uses input from coretemp module and sets the fan speed using the applesmc module
30 lines
889 B
Diff
30 lines
889 B
Diff
diff --git a/src/main.c b/src/main.c
|
|
index e8af708..6cfee17 100644
|
|
--- a/src/main.c
|
|
+++ b/src/main.c
|
|
@@ -71,7 +71,7 @@ void check_requirements()
|
|
* Check for coretemp and applesmc modules
|
|
* Credits: -http://stackoverflow.com/questions/12978794
|
|
*/
|
|
- FILE *fd = popen("lsmod | grep coretemp", "r");
|
|
+ FILE *fd = popen("@LSMOD@ | @GREP@ coretemp", "r");
|
|
char buf[16];
|
|
|
|
if (!(fread (buf, 1, sizeof (buf), fd) > 0)) {
|
|
@@ -87,7 +87,7 @@ void check_requirements()
|
|
|
|
pclose(fd);
|
|
|
|
- fd = popen("lsmod | grep applesmc", "r");
|
|
+ fd = popen("@LSMOD@ | @GREP@ applesmc", "r");
|
|
|
|
if (!(fread (buf, 1, sizeof (buf), fd) > 0)) {
|
|
DIR* dir = opendir(APPLESMC_PATH);
|
|
@@ -145,4 +145,4 @@ int main(int argc, char *argv[])
|
|
void (*fan_control)() = mbpfan;
|
|
go_daemon(fan_control);
|
|
exit(EXIT_SUCCESS);
|
|
-}
|
|
\ No newline at end of file
|
|
+}
|