 
 
 let  smc = SMC()
-smc.open()
+if (smc.open() == kIOReturnSuccess) {
+    HAS_SMC = true
+}
 
 // TODO check if laptop
 let battery = Battery()
-let isLaptop = battery.isLaptop()
+HAS_BATTERY = battery.isLaptop()
 battery.open()
 
 
-widgets.append(TMPWidget(win: Window(size: (length: 0, width: 1), pos: (x: 0, y: 0))))
-widgets.append(FanWidget(win: Window(size: (length: 0, width: 1), pos: (x: 0, y: 0))))
-widgets.append(BatteryWidget(win: Window(size: (length: 0, width: 1), pos: (x: 0, y: 0))))
+if (HAS_SMC) {
+    widgets.append(TMPWidget(win: Window()))
+    widgets.append(FanWidget(win: Window()))
+}
+
+if (HAS_BATTERY) {
+    widgets.append(BatteryWidget(win: Window()))
+}
 
 var widgetLength = computeWidgetLength()
 



public struct Window {
    var size  : (length : Int32, width : Int32)
    var pos   : (x : Int32, y : Int32)
}



*/
let VERSION = "0.0.1"
let MAX_WIDTH = 20.0

var HAS_BATTERY = false
var HAS_SMC     = false


// TODO: This should probably be a serial queue
