From 4f065cca7aeca81625eaf904b7a18847b9dced1e Mon Sep 17 00:00:00 2001 From: FTCHD <144691102+FTCHD@users.noreply.github.com> Date: Fri, 24 Oct 2025 20:35:19 +0200 Subject: [PATCH] tray icon light/dark, fixes #58 Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com> --- lib/tray.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/tray.ts b/lib/tray.ts index 969d8b4..f2776ee 100644 --- a/lib/tray.ts +++ b/lib/tray.ts @@ -26,8 +26,14 @@ async function getTray() { async function resolveTrayIconForTheme() { let theme: 'light' | 'dark' = 'dark' try { - const t = (await invoke('get_system_theme')) || 'dark' - theme = t === 'dark' ? 'dark' : 'light' + if (platform() === 'macos') { + const t = (await invoke('get_system_theme')) || 'dark' + theme = t === 'dark' ? 'dark' : 'light' + } else { + const currentWindow = getCurrentWindow() + const t = await currentWindow.theme() + theme = t === 'dark' ? 'dark' : 'light' + } } catch {} console.log('[resolveTrayIconForTheme] theme', theme)