macOS support

This commit is contained in:
sarah committed 2026-10-14 13:18:18 +02:00
1 parent 5613f4f8fe
commit 1bd37db1ba
8 files changed
+113 -29

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ from typing import Callable, Optional
import flet as ft
from Core import AppConfig, ChildEnvironment, ChipButton, IsWindows, Note, NotificationStyle, Palette
from Core import AppConfig, ChildEnvironment, ChipButton, IsMac, IsWindows, Note, NotificationStyle, Palette
from Service import RestartIfRunning
from Sortd import Setup, SortdError
@@ -72,7 +72,7 @@ class App:
if IsWindows:
os.startfile(PathText) # Explorer
else:
subprocess.Popen(["xdg-open", PathText], env=ChildEnvironment(), start_new_session=True)
subprocess.Popen(["open" if IsMac else "xdg-open", PathText], env=ChildEnvironment(), start_new_session=True)
except OSError as Error:
self.Notify(f"Couldn't open {PathText}: {Error}", "error")