Skip to content

Commit

Permalink
Monitor changes on PreventUserIdleSystemSleep too
Browse files Browse the repository at this point in the history
Fixes tab changing bug
  • Loading branch information
caseymrm committed May 15, 2018
1 parent 31a3249 commit f010058
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Binary file modified WhyAwake.app/Contents/MacOS/whyawake
Binary file not shown.
8 changes: 5 additions & 3 deletions whyawake.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import (

var sleepKeywords = map[string]bool{
"PreventUserIdleDisplaySleep": true,
//"PreventUserIdleSystemSleep": true,
"NoDisplaySleepAssertion": true,
"NoDisplaySleepAssertion": true,
}
var otherChangeKeywords = map[string]bool{
"PreventUserIdleSystemSleep": true,
}
var canSleepTitle = "💤"
var cantSleepTitle = "😳"
Expand Down Expand Up @@ -111,7 +113,7 @@ func setMenuState() {

func monitorAssertionChanges(channel chan assertions.AssertionChange) {
for change := range channel {
if sleepKeywords[change.Type] {
if sleepKeywords[change.Type] || otherChangeKeywords[change.Type] {
setMenuState()
}
}
Expand Down

0 comments on commit f010058

Please sign in to comment.