Skip to content

Commit

Permalink
Fix activation time no longer working in Sonoma
Browse files Browse the repository at this point in the history
  • Loading branch information
glouel committed Jun 30, 2023
1 parent e19efe2 commit a901e90
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
16 changes: 8 additions & 8 deletions AerialUpdater/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="22113.3" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22113.3"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -706,39 +706,39 @@
<action selector="desiredVersionPopupChange:" target="XfG-lQ-9wD" id="LAN-Gm-0mH"/>
</connections>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="PHQ-kl-Gd8">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="PHQ-kl-Gd8">
<rect key="frame" x="60" y="174" width="102" height="16"/>
<textFieldCell key="cell" controlSize="large" lineBreakMode="clipping" alignment="right" title="Desired version:" id="FcP-U5-dBi">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="31W-lc-dSb">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="31W-lc-dSb">
<rect key="frame" x="43" y="131" width="119" height="16"/>
<textFieldCell key="cell" controlSize="large" lineBreakMode="clipping" alignment="right" title="Currently installed:" id="Tqc-5z-agH">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ish-Ba-7Yp">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ish-Ba-7Yp">
<rect key="frame" x="60" y="95" width="102" height="16"/>
<textFieldCell key="cell" controlSize="large" lineBreakMode="clipping" alignment="right" title="Latest available:" id="QGM-v8-TYZ">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HaJ-0z-nGG">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HaJ-0z-nGG">
<rect key="frame" x="178" y="131" width="37" height="16"/>
<textFieldCell key="cell" controlSize="large" lineBreakMode="clipping" title="Label" id="b5F-H3-o9D">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bod-Mv-xj4">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bod-Mv-xj4">
<rect key="frame" x="178" y="95" width="37" height="16"/>
<textFieldCell key="cell" controlSize="large" lineBreakMode="clipping" title="Label" id="I1U-hN-3bT">
<font key="font" metaFont="system"/>
Expand All @@ -759,7 +759,7 @@
<action selector="installNowButtonClick:" target="XfG-lQ-9wD" id="qil-HB-44r"/>
</connections>
</button>
<textField horizontalHuggingPriority="25" verticalHuggingPriority="75" horizontalCompressionResistancePriority="75" verticalCompressionResistancePriority="75" translatesAutoresizingMaskIntoConstraints="NO" id="MI1-En-lZD">
<textField focusRingType="none" horizontalHuggingPriority="25" verticalHuggingPriority="75" horizontalCompressionResistancePriority="75" verticalCompressionResistancePriority="75" translatesAutoresizingMaskIntoConstraints="NO" id="MI1-En-lZD">
<rect key="frame" x="54" y="14" width="37" height="16"/>
<textFieldCell key="cell" controlSize="large" lineBreakMode="clipping" title="Label" id="RPJ-eh-obu">
<font key="font" metaFont="system"/>
Expand Down
1 change: 0 additions & 1 deletion AerialUpdater/Model/Helpers/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ struct Helpers {
let data = pipe.fileHandleForReading.readDataToEndOfFile()
let output = String(data: data, encoding: .utf8)
task.waitUntilExit()

return output
}

Expand Down
14 changes: 8 additions & 6 deletions AerialUpdater/Model/SystemPrefs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ struct SystemPrefs {


static func setSaverActivationTime(time:Int) {
// defaults -currentHost write com.apple.screensaver idleTime timeInSeconds
// defaults -currentHost write com.apple.screensaver idleTime -int timeInSeconds
// Note : -int became required at some point in Ventura, if not specified it defaults to string nowadays. This parameter is available since 2003 so this is backward compatible
_ = Helpers.shell(launchPath: "/usr/bin/defaults",
arguments: ["-currentHost",
"write",
"com.apple.screensaver",
"idleTime",
String(time*60)])
arguments: ["-currentHost",
"write",
"com.apple.screensaver",
"idleTime",
"-int",
String(time*60)])
}


Expand Down

0 comments on commit a901e90

Please sign in to comment.