+gboolean determine_chassis_and_icon() {
+
+ char *hwproduct, *hwmodel, *hwvendor, *hwmachine;
+ size_t hwproduct_size, hwmodel_size, hwvendor_size, hwmachine_size;
+ int hwproduct_name[2], hwmodel_name[2], hwvendor_name[2], hwmachine_name[2];
+ unsigned int i;
+ gboolean UNSURE_CHASSIS_FLAG, UNSURE_ICON_FLAG;
+
+ hwproduct = hwmodel = hwvendor = hwmachine = NULL;
+ hwproduct_size = hwmodel_size = hwvendor_size = hwmachine_size = 0;
+ UNSURE_CHASSIS_FLAG = UNSURE_ICON_FLAG = FALSE;
+
+ hwproduct_name[0] = CTL_HW;
+ hwproduct_name[1] = HW_PRODUCT;
+
+ hwmodel_name[0] = CTL_HW;
+ hwmodel_name[1] = HW_MODEL;
+
+ hwvendor_name[0] = CTL_HW;
+ hwvendor_name[1] = HW_VENDOR;
+
+ hwmachine_name[0] = CTL_HW;
+ hwmachine_name[1] = HW_MACHINE;
+
+ /* pass NULL buffer to check size first, then pass hw to be filled according to freshly-set hw_size */
+ if(-1 == sysctl(hwproduct_name, 2, NULL, &hwproduct_size, NULL, 0) || -1 == sysctl(hwproduct_name, 2, hwproduct, &hwproduct_size, NULL, 0))
+ return FALSE;
+
+ if(-1 == sysctl(hwmodel_name, 2, NULL, &hwmodel_size, NULL, 0) || -1 == sysctl(hwmodel_name, 2, hwmodel, &hwmodel_size, NULL, 0))
+ return FALSE;
+
+ if(-1 == sysctl(hwvendor_name, 2, NULL, &hwvendor_size, NULL, 0) || -1 == sysctl(hwvendor_name, 2, hwvendor, &hwvendor_size, NULL, 0))
+ return FALSE;