Skip to content

Commit

Permalink
Merge branch '1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
newmarcel committed Dec 23, 2014
2 parents 3f0dcba + fa3b9e4 commit 2ee24a4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Changelog ##

### v1.2.1 ###
- Less aggressive awake handling when the MacBook lid is closed by using the `caffeinate -di` command instead of `caffeinate -disu`
- You can revert back to the previous behaviour by pasting the following snippet into *Terminal.app*:

defaults write info.marcel-dierkes.KeepingYouAwake.PreventSleepOnACPower -bool YES


### v1.2 ###
- There are no significant changes since beta1
- Tweaked the experimental *(and hidden)* notifications
Expand Down
4 changes: 2 additions & 2 deletions KeepingYouAwake.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
/* Begin PBXCopyFilesBuildPhase section */
DA3C1C771A1533200079A195 /* Copy Sparkle */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
buildActionMask = 8;
dstPath = "";
dstSubfolderSpec = 10;
files = (
DA3C1C781A1533320079A195 /* Sparkle.framework in Copy Sparkle */,
);
name = "Copy Sparkle";
runOnlyForDeploymentPostprocessing = 0;
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */

Expand Down
4 changes: 2 additions & 2 deletions KeepingYouAwake/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<string>1.2.1beta1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>120</string>
<string>121</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSUIElement</key>
Expand Down
12 changes: 11 additions & 1 deletion KeepingYouAwake/KYASleepWakeTimer.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import "KYASleepWakeTimer.h"

NSString * const KYASleepWakeTimerUserDefaultsKeyPreventSleepOnACPower = @"info.marcel-dierkes.KeepingYouAwake.PreventSleepOnACPower";

NSTimeInterval const KYASleepWakeTimeIntervalIndefinite = 0;

@interface KYASleepWakeTimer ()
Expand Down Expand Up @@ -77,7 +79,15 @@ - (BOOL)isScheduled
- (void)spawnCaffeinateTaskForTimeInterval:(NSTimeInterval)timeInterval
{
NSMutableArray *arguments = [NSMutableArray new];
[arguments addObject:@"-disu"];

if([[NSUserDefaults standardUserDefaults] boolForKey:KYASleepWakeTimerUserDefaultsKeyPreventSleepOnACPower])
{
[arguments addObject:@"-disu"];
}
else
{
[arguments addObject:@"-di"];
}

if(timeInterval != KYASleepWakeTimeIntervalIndefinite)
[arguments addObject:[NSString stringWithFormat:@"-t %.f", timeInterval]];
Expand Down

0 comments on commit 2ee24a4

Please sign in to comment.