         // caused a linker error due to NSVariableStatusItemLength changing to a CGFloat.
         statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
         
-        // Add the inital image to the statusItem.
+        // Create an action when the item is clicked.
+        statusItem.action = Selector("itemClicked:")
+        
+        // If the mac os x theme is currently light, use the light image.
         statusItem.image = NSImage(named: "Sunny")
         
-        // Create an action when the item is clicked.
-        statusItem.action = Selector("itemClicked:")
+        // Set image as a template in order for dark mode changes to take effect.
+        statusItem.image?.setTemplate(true)
     }
     
     /**

    
    /// Status for the assertion depicting the reason for the activity.
    var reasonForActivity = "DontSleep is on -- so don't sleep!" as CFString

    // MARK: Methods
    
    func applicationDidFinishLaunching(aNotification: NSNotification) {

            // Change the status menu item back to the default image.
            statusItem.image = NSImage(named: "Sunny")
            
            // Set image as a template in order for dark mode changes to take effect.
            statusItem.image?.setTemplate(true)
            
            // If the assertion previously succeeded, relase it.
            if success == kIOReturnSuccess {
                IOPMAssertionRelease(assertionID);
