Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

add app to open at login by default

Eva Hobc54daf2bc57
diff --git a/app/src/index.ts b/app/src/index.ts
index e2cf847ee..5db19198f 100644
--- a/app/src/index.ts
+++ b/app/src/index.ts
@@ -1,5 +1,6 @@
import { spawn, exec } from 'child_process'
import { app, autoUpdater, dialog, Tray, Menu } from 'electron'
+import Store from 'electron-store'
import * as path from 'path'
import * as fs from 'fs'
@@ -7,6 +8,8 @@ import { analytics, id } from './telemetry'
require('@electron/remote/main').initialize()
+
+const store = new Store();
let tray: Tray | null = null
const SingleInstanceLock = app.requestSingleInstanceLock()
@@ -23,7 +26,9 @@ const createSystemtray = () => {
tray = new Tray(iconPath)
- const contextMenu = Menu.buildFromTemplate([{ role: 'quit', label: 'Quit Ollama', accelerator: 'Command+Q' }])
+ const contextMenu = Menu.buildFromTemplate([
+ { role: 'quit', label: 'Quit Ollama', accelerator: 'Command+Q' }
+ ])
tray.setContextMenu(contextMenu)
tray.setToolTip('Ollama')
@@ -107,6 +112,15 @@ app.on('ready', () => {
if (process.platform === 'darwin') {
app.dock.hide()
+ if (!store.has('first-time-run')) {
+ // This is the first run
+ app.setLoginItemSettings({ openAtLogin: true })
+ store.set('first-time-run', false);
+ } else {
+ // The app has been run before
+ app.setLoginItemSettings({ openAtLogin: app.getLoginItemSettings().openAtLogin })
+ }
+
if (!app.isInApplicationsFolder()) {
const chosen = dialog.showMessageBoxSync({
type: 'question',