]> git.sur5r.net Git - i3/i3status/blobdiff - src/config.c
Implement battery status and thermal zones for FreeBSD (patch by Baptiste Daroussin)
[i3/i3status] / src / config.c
index 8fff8d0e1e6d16466a3242087fe1fb4e47c643e6..2d9d6b67d5118b5233b2881b514ecd9ccdfa4507 100644 (file)
@@ -69,13 +69,11 @@ int load_configuration(const char *configfile) {
                         get_ethspeed = true;
                 OPT("get_cpu_temperature") {
                         get_cpu_temperature = true;
-                        if (strlen(dest_value) > 0) {
-                                if (asprintf(&thermal_zone, "/sys/class/thermal/thermal_zone%d/temp", atoi(dest_value)) == -1)
-                                        die("Could not build thermal_zone path\n");
-                        } else {
-                                 if (asprintf(&thermal_zone, "/sys/class/thermal/thermal_zone0/temp") == -1)
-                                        die("Could not build thermal_zone path\n");
-                        }
+                        int zone = 0;
+                        if (strlen(dest_value) > 0)
+                            zone = atoi(dest_value);
+                        if (asprintf(&thermal_zone, THERMAL_ZONE, zone) == -1)
+                            die("Could not build thermal_zone path\n");
                 } OPT("normcolors")
                         wmii_normcolors = strdup(dest_value);
                 OPT("interval")