From 9c344efc371f1cd1b0922b0658ca67678a94914b Mon Sep 17 00:00:00 2001 From: blackxfiied <41133734+blackxfiied@users.noreply.github.com> Date: Thu, 28 Mar 2024 18:12:56 +0800 Subject: [PATCH] Add winecfg awareness --- Mythic/Views/BottleList.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Mythic/Views/BottleList.swift b/Mythic/Views/BottleList.swift index ce5f1e5f..8f9258d1 100644 --- a/Mythic/Views/BottleList.swift +++ b/Mythic/Views/BottleList.swift @@ -16,6 +16,8 @@ struct BottleListView: View { @State private var selectedBottleName: String = .init() @State private var bottleNameToDelete: String = .init() + @State private var configuratorActive: Bool = false + var body: some View { if let bottles = Wine.allBottles { Form { @@ -101,6 +103,12 @@ struct BottleListView: View { ) } } + .disabled(configuratorActive) + .task(priority: .background) { + Timer.scheduledTimer(withTimeInterval: 5.0, repeats: true) { timer in + configuratorActive = (try? Process.execute("/bin/bash", arguments: ["-c", "ps aux | grep winecfg | grep -v grep"]))?.isEmpty == false + } + } Button("Close") { isBottleSettingsViewPresented = false