![](img/pic2.png)
+FreeBSD
+
+![](img/pic5.png)
+
Gather some system information and show it in this statusbar program, not tied to any Window Manager, terminal multiplexer, etc.
Please note that the program won't detect fans connected via molex connetor(s) or external fan controller. Also I have not tested it with fan splitter(s) either.
If you compile your kernel from source code make sure to include your cpu and motherboard sensors as **modules** and not inlined.
-Just an example if you use FreeBSD - acpi/aibs, coretemp/amdtemp.
+**Just an example if you use FreeBSD - acpi/aibs, coretemp/amdtemp.**
![](img/cpu-temp.png)
![](img/mobo-temp.png)
temp2 / 100 : temp2 / 10)); /* > 9C || < 9C */
}
}
+
+
+void
+get_fans(char *str1) {
+ u_int fan[3];
+ char tempstr[VLA], buffer[VLA];
+ char *all_fans = buffer;
+ uint_fast16_t x = 0, y = 0, z = 0, rpm[21];
+
+ memset(fan, 0, sizeof(fan));
+ memset(rpm, 0, sizeof(rpm));
+ size_t len = sizeof(fan);
+
+ for (x = 0; x < 20; x++) {
+ FILL_ARR(tempstr, "%s"UFINT, "dev.aibs.0.fan.", x);
+ memset(fan, 0, sizeof(fan));
+ if (0 != sysctlbyname(tempstr, &fan, &len, NULL, 0)) {
+ break;
+ }
+ rpm[x] = (uint_fast16_t)fan[0];
+ }
+
+ if (0 == rpm[0]) { /* no system fans at all */
+ FILL_STR_ARR(1, str1, NOT_FOUND);
+ return;
+ }
+
+ z = x;
+ for (x = 0; x < z; x++) {
+ if (0 < rpm[x])
+ GLUE2(all_fans, UFINT" ", rpm[x]);
+ else
+ ++y; /* non-spinning | removed | failed fan */
+ }
+ FILL_STR_ARR(1, str1, (y != x ? buffer : NOT_FOUND));
+}
NEW_LABEL('d', char mobo_temp[VLA], mobo_temp, FMT_TEMP);
+ NEW_LABEL('f', char fans[VLA], fans, FMT_FANS, FANS_STR);
+
NEW_LABEL('t', char taim[VLA], taim, FMT_TIME" ", TIME_STR);
NEW_NET_LABEL('b', char net[VLA], net, 1, FMT_NET, NET_STR);
NEW_ARG_LABEL('F', char ssd_model[VLA], ssd_model, FMT_KERN);
- NEW_LABEL('f', char fans[VLA], fans, FMT_FANS, FANS_STR);
-
NEW_NET_LABEL('h', char nic_drv[VLA], nic_drv, 8, FMT_KERN);
NEW_NET_LABEL('H', char nic_ver[VLA], nic_ver, 9, FMT_KERN);
void get_voltage(char *);
void get_mobo(char *);
void get_mobo_temp(char *);
+void get_fans(char *);
#if defined(__linux__)
void get_ssd_model(char *, char *);
-void get_fans(char *);
void get_statio(char *, char *);
void get_battery(char *);
#endif