{"action":"created","issue":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/520","labels_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/520/comments","events_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/520/events","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/520","id":103113099,"number":520,"title":"hs.screen.watcher not triggered after hibernate","user":{"login":"patrickli","id":502326,"avatar_url":"https://avatars.githubusercontent.com/u/502326?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickli","html_url":"https://github.com/patrickli","followers_url":"https://api.github.com/users/patrickli/followers","following_url":"https://api.github.com/users/patrickli/following{/other_user}","gists_url":"https://api.github.com/users/patrickli/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickli/subscriptions","organizations_url":"https://api.github.com/users/patrickli/orgs","repos_url":"https://api.github.com/users/patrickli/repos","events_url":"https://api.github.com/users/patrickli/events{/privacy}","received_events_url":"https://api.github.com/users/patrickli/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/labels/docs","name":"docs","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-25T20:46:24Z","updated_at":"2015-09-03T20:15:21Z","closed_at":null,"body":"## Environment\r\n### Software\r\nOSX Yosemite 10.10.5\r\n* Require password after sleep\r\n* FileVault on\r\n\r\nHammerspoon 0.9.38\r\n### Hardware\r\nMacBook Pro (Retina, 15-inch, Mid 2014)\r\n1x External Monitor (set as primary)\r\n\r\n## Steps to reproduce\r\n1. Implement a `hs.screen.watcher` with a callback to `print` a debug message whenever it triggers.\r\n1. With external monitor connected, put computer to sleep.\r\n1. Disconnect power and monitor.\r\n1. Leave the computer long enough so it enters hibernate.\r\n1. Wake the computer up but don't enter the password yet.\r\n1. Connect the external monitor.\r\n1. Enter the password to unlock the computer.\r\n\r\n## Expected outcome\r\nThere should be console output at steps `5` and `6`.\r\n\r\n## Actual outcome\r\nNo debug message was triggered at all.\r\n\r\n## Thoughts\r\nIf I skip `4`, screen watchers are triggered properly. So I wonder if that's because of the FileVault and hibernate. Since I am using FileVault, harddrive is locked when waking up from hibernate and the page file is not loaded into memory. So hammerspoon is not actually running. When unlocked, the monitors are already connected so there is no change to monitor layout as hammerspoon's concern. However the windows are rearranged by OSX because of steps `5` and `6`. That puzzles me."},"comment":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/comments/137561924","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/520#issuecomment-137561924","issue_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/520","id":137561924,"user":{"login":"lowne","id":6718755,"avatar_url":"https://avatars.githubusercontent.com/u/6718755?v=3","gravatar_id":"","url":"https://api.github.com/users/lowne","html_url":"https://github.com/lowne","followers_url":"https://api.github.com/users/lowne/followers","following_url":"https://api.github.com/users/lowne/following{/other_user}","gists_url":"https://api.github.com/users/lowne/gists{/gist_id}","starred_url":"https://api.github.com/users/lowne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowne/subscriptions","organizations_url":"https://api.github.com/users/lowne/orgs","repos_url":"https://api.github.com/users/lowne/repos","events_url":"https://api.github.com/users/lowne/events{/privacy}","received_events_url":"https://api.github.com/users/lowne/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T20:15:21Z","updated_at":"2015-09-03T20:15:21Z","body":"@patrickli According to `man pmset`, it seems (haven't tried it myself yet) that you can change the hibernation timer via `pmset autopoweroffdelay` to facilitate testing."}}