 
     @IBOutlet weak var statusMenu:NSMenu!
     
+    let LEFT_MOUSE_BUTTON = 1
+    
     let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
+    
+    var task = NSTask()
+    var stayAwake = false
     
     func applicationDidFinishLaunching(aNotification: NSNotification) {
         statusItem.title = "Stay Awake"

    }
    
    func menuItemClicked() {
        println("Test")
    }

    @IBAction func aboutMenuItemClicked(sender: AnyObject) {
    }

    @IBAction func quitMenuItemClicked(sender: AnyObject) {
    }

}

    }
    
    func applicationWillTerminate(aNotification: NSNotification) {
        disableInsomnia()
    }

    func menuWillOpen(menu:NSMenu) {
        let mouseButton = NSEvent.pressedMouseButtons()
        
        if mouseButton == LEFT_MOUSE_BUTTON {
            // don't open menu
            menu.cancelTracking()
            
