Skip to content

Commit

Permalink
Updating README - adding setting for animations
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPerathoner committed Mar 19, 2020
1 parent ec8cac8 commit 3fc455a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--©Alexander Perathoner 19/03/2020-->

<img align="right" width="25%" src="Screens/Icon1024.png"></img>
# SlimHUD - Cyanocitta
Expand All @@ -7,7 +8,7 @@ Every day you change your volume or brightness and an ugly and unbelievably old
## Features


###Settings
### Settings

## Installation
Download the [latest release](https://github.com/AlexPerathoner/SlimHUD/releases/latest).
Expand All @@ -18,10 +19,10 @@ Launching SlimHud is easy: copy the app into your Application's folder and then
1. Enter Recovery Mode by restarting your mac and holding ⌘+R while it's booting up.
2. Launch the terminal by clicking on Utilities > Terminal.
3. Disable SIP with ```crsutil disable```.
4. Restart your mac and login into your account.
5. Navigate to /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist
6. As com.apple.OSDUIHelper.plist is a read-only file, to modify it, you'll first need to run ```sudo mount -uw; killall Finder```
7. You can now open com.apple.OSDUIHelper.plist and remove all of the text between \<plist version=”1.0″> and \</plist>. Save the file.
4. Restart your mac and login into an admin account.
5. Run ```sudo mount -uw /; killall Finder``` in your terminal.
6. Now run ```sudo nano /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist```.
6. Remove all of the text between \<plist version=”1.0″> and \</plist>. Save the file by hitting control + X, answering yes and hitting return.
8. Re-enter Recovery mode.
9. Enable SIP with ```crsutil enable```.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
filePath = "SlimHUD/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "177"
endingLineNumber = "177"
startingLineNumber = "168"
endingLineNumber = "168"
landmarkName = "AppDelegate"
landmarkType = "3">
</BreakpointContent>
Expand All @@ -30,8 +30,8 @@
filePath = "SlimHUD/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "168"
endingLineNumber = "168"
startingLineNumber = "158"
endingLineNumber = "158"
landmarkName = "AppDelegate"
landmarkType = "3">
</BreakpointContent>
Expand All @@ -46,8 +46,8 @@
filePath = "SlimHUD/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "170"
endingLineNumber = "170"
startingLineNumber = "160"
endingLineNumber = "160"
landmarkName = "AppDelegate"
landmarkType = "3">
</BreakpointContent>
Expand Down
8 changes: 8 additions & 0 deletions SlimHUD/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ import QuartzCore
class AppDelegate: NSObject, NSApplicationDelegate, SettingsWindowControllerDelegate {

// MARK: - Settings & setups
var shouldUseAnimation = true {
didSet {
volumeHud.animated = shouldUseAnimation
brightnessHud.animated = shouldUseAnimation
backlightHud.animated = shouldUseAnimation
}
}
private let shadowRadius: CGFloat = 20
var disabledColor = NSColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 0.9)
var enabledColor = NSColor(red: 0.19, green: 0.5, blue: 0.96, alpha: 0.9)
Expand Down Expand Up @@ -230,6 +237,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, SettingsWindowControllerDele
oldBacklight = getKeyboardBrightness()
oldBrightness = getDisplayBrightness()

shouldUseAnimation = settingsController.shouldUseAnimation

volumeHud.view = volumeView
brightnessHud.view = brightnessView
Expand Down
7 changes: 7 additions & 0 deletions SlimHUD/Settings/SettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class SettingsController {
setItem(shouldContinuouslyCheck, for: "shouldContinuouslyCheck")
}
}
var shouldUseAnimation: Bool! = true {
didSet {
setItem(shouldUseAnimation, for: "shouldUseAnimation")
}
}

var barHeight: Int = 218 {
didSet {
setItem(barHeight, for: "barHeight")
Expand All @@ -88,6 +94,7 @@ class SettingsController {
barHeight = getItem(for: "barHeight", defaultValue: 218)
position = Position(rawValue: getItem(for: "position", defaultValue: "left"))!
shouldContinuouslyCheck = getItem(for: "shouldContinuouslyCheck", defaultValue: true)
shouldUseAnimation = getItem(for: "shouldUseAnimation", defaultValue: true)
}

func resetDefaultColors() {
Expand Down
6 changes: 5 additions & 1 deletion SlimHUD/Settings/SettingsWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SettingsWindowController" customModule="SlimHUD" customModuleProvider="target">
<connections>
<outlet property="animationsOutlet" destination="Y2n-yd-yjv" id="Q2O-Yo-9AP"/>
<outlet property="backgroundColorOutlet" destination="4qz-TG-UWa" id="nmV-ER-j90"/>
<outlet property="brightnessColorOutlet" destination="hKR-xu-s77" id="nsc-D4-NLc"/>
<outlet property="continuousCheckOutlet" destination="f2W-ZC-Pft" id="tXF-CM-2mP"/>
Expand Down Expand Up @@ -221,7 +222,7 @@
<constraints>
<constraint firstAttribute="height" constant="14" id="Wv1-08-JUf"/>
</constraints>
<buttonCell key="cell" type="check" title="Launch at login" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="XEr-hX-KPK">
<buttonCell key="cell" type="check" title="Launch at login" bezelStyle="regularSquare" imagePosition="left" inset="2" id="XEr-hX-KPK">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="13"/>
</buttonCell>
Expand Down Expand Up @@ -280,6 +281,9 @@
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="13"/>
</buttonCell>
<connections>
<action selector="shouldUseAnimations:" target="-2" id="WTm-aX-HFe"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="f2W-ZC-Pft">
<rect key="frame" x="113" y="309" width="131" height="18"/>
Expand Down
12 changes: 12 additions & 0 deletions SlimHUD/Settings/SettingsWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ protocol SettingsWindowControllerDelegate: class {
func setBacklightColor(color: NSColor)
func setHeight(height: CGFloat)
func setupHUDsPosition()
var shouldUseAnimation: Bool { get set }
}
class SettingsWindowController: NSWindowController {

Expand All @@ -30,6 +31,8 @@ class SettingsWindowController: NSWindowController {
launchAtLoginOutlet.state = LaunchAtLogin.isEnabled.toStateValue()
iconOutlet.state = settingsController?.shouldShowIcons!.toStateValue() ?? .on
shadowOutlet.state = settingsController?.shouldShowShadows.toStateValue() ?? .on
continuousCheckOutlet.state = settingsController?.shouldContinuouslyCheck.toStateValue() ?? .on
animationsOutlet.state = settingsController?.shouldUseAnimation.toStateValue() ?? .on
backgroundColorOutlet.color = settingsController!.backgroundColor
volumeEnabledColorOutlet.color = settingsController!.volumeEnabledColor
volumeDisabledColorOutlet.color = settingsController!.volumeDisabledColor
Expand Down Expand Up @@ -57,6 +60,7 @@ class SettingsWindowController: NSWindowController {
@IBOutlet weak var iconOutlet: NSButton!
@IBOutlet weak var shadowOutlet: NSButton!
@IBOutlet weak var continuousCheckOutlet: NSButton!
@IBOutlet weak var animationsOutlet: NSButton!

@IBOutlet weak var backgroundColorOutlet: NSColorWell!
@IBOutlet weak var volumeEnabledColorOutlet: NSColorWell!
Expand Down Expand Up @@ -110,8 +114,16 @@ class SettingsWindowController: NSWindowController {

@IBAction func shouldContinuouslyCheck(_ sender: NSButton) {
settingsController?.shouldContinuouslyCheck = sender.state.boolValue()

}

@IBAction func shouldUseAnimations(_ sender: NSButton) {
let val = sender.state.boolValue()
settingsController?.shouldUseAnimation = val
delegate?.shouldUseAnimation = val
}



@IBAction func resetDefaults(_ sender: Any) {
delegate?.setupDefaultColors()
Expand Down

0 comments on commit 3fc455a

Please sign in to comment.