Skip to content

Commit f40d245

Browse files
feat: add support custom themes (#672)
1 parent 9d59e3e commit f40d245

11 files changed

Lines changed: 846 additions & 42 deletions

File tree

src/main/i18n/locales/en_US/preferences.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@
6767
"label": "Appearance",
6868
"theme": {
6969
"label": "Theme",
70+
"builtIn": "Built-in",
71+
"custom": "Custom",
72+
"themesDir": "Themes Directory",
73+
"openDir": "Open Themes Directory",
74+
"createTemplate": "Create Theme Template",
75+
"dirDescription": "Place your JSON theme files in this folder.",
7076
"light": "Light",
7177
"dark": "Dark",
7278
"system": "System"

src/main/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { initApi } from './api'
77
import { startAutoBackup } from './db'
88
import { migrateJsonToSqlite } from './db/migrate'
99
import { registerIPC } from './ipc'
10+
import { startThemeWatcher, stopThemeWatcher } from './ipc/handlers/theme'
1011
import { mainMenu } from './menu/main'
1112
import { store } from './store'
1213
import { checkForUpdates } from './updates'
@@ -124,6 +125,13 @@ else {
124125
log('Error registering IPC', error)
125126
}
126127

128+
try {
129+
startThemeWatcher()
130+
}
131+
catch (error) {
132+
log('Error starting theme watcher', error)
133+
}
134+
127135
try {
128136
await initApi()
129137
}
@@ -167,6 +175,7 @@ else {
167175

168176
app.on('before-quit', () => {
169177
isQuitting = true
178+
stopThemeWatcher()
170179
})
171180

172181
app.on('window-all-closed', () => {

0 commit comments

Comments
 (0)