aboutsummaryrefslogtreecommitdiffstats
path: root/Low Battery Yup/DaemonLauncher.h
diff options
context:
space:
mode:
authorTeddy Wing2016-12-02 13:00:19 -0500
committerTeddy Wing2016-12-02 13:00:19 -0500
commita77a053f90a7b2588dbaabedbf25f908680f2f30 (patch)
treeb1dcf8706c1e6a82e8505f2fa09dc22e0a197ecd /Low Battery Yup/DaemonLauncher.h
parent055471fad0187e654302034a0875a417e73e089f (diff)
downloadLow-Battery-Yup-a77a053f90a7b2588dbaabedbf25f908680f2f30.tar.bz2
Add "Start at login" checkbox that [un]installs launch agent
A new checkbox in the UI that asks whether the app should start at login. Checking and unchecking the box moves a LaunchAgent plist into and out of `~/Library/LaunchAgents/`. This plist file will define instructions to start the daemon on login. Also add a `DaemonLauncher` class that will launch or quit the daemon when the checkbox is clicked. Bug: Currently the app always starts with the checkbox checked. That's not what should happen. Instead, we should save the checkbox value to `NSUserDefaults` so that it has the previous value when the program is launched.
Diffstat (limited to 'Low Battery Yup/DaemonLauncher.h')
-rw-r--r--Low Battery Yup/DaemonLauncher.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Low Battery Yup/DaemonLauncher.h b/Low Battery Yup/DaemonLauncher.h
new file mode 100644
index 0000000..a62a256
--- /dev/null
+++ b/Low Battery Yup/DaemonLauncher.h
@@ -0,0 +1,13 @@
+//
+// DaemonLauncher.h
+// Low Battery Yup.d
+//
+// Created by TW on 12/2/16.
+// Copyright (c) 2016 TW. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface DaemonLauncher : NSObject
+
+@end