From ec909a4d35efc3b36e206c047630d1a68a6cbd70 Mon Sep 17 00:00:00 2001 From: Raine Virta Date: Tue, 24 Sep 2024 15:31:54 +0300 Subject: [PATCH] add launch at login to settings --- Lolgato/Settings.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Lolgato/Settings.swift b/Lolgato/Settings.swift index ac4e566..13e98a6 100644 --- a/Lolgato/Settings.swift +++ b/Lolgato/Settings.swift @@ -1,4 +1,5 @@ import KeyboardShortcuts +import LaunchAtLogin import SwiftUI struct SettingsView: View { @@ -7,7 +8,7 @@ struct SettingsView: View { var body: some View { GeneralSettingsView(appState: appState) .padding(30) - .frame(width: 500, height: 300) + .frame(width: 500, height: 380) } } @@ -28,6 +29,14 @@ struct GeneralSettingsView: View { Text("Turn off lights when system goes to sleep or is locked.") } + Divider() + + settingRow(label: "Launch:") { + LaunchAtLogin.Toggle("Automatically at system startup") + } + + Divider() + shortcutRow( label: "Toggle Lights:", shortcut: .toggleLights, @@ -53,6 +62,7 @@ struct GeneralSettingsView: View { KeyboardShortcuts.reset(.toggleLights) appState.lightsOnWithCamera = false appState.lightsOffOnSleep = false + LaunchAtLogin.isEnabled = false } }