File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
desktopMain/kotlin/org/close_all/project/service Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 11app.name =closeAll
22# list (separated by ,) of CoreServices apps that we want to show
3- app.relevantCoreServices =Finder
3+ # '*' for all, 'None' for none
4+ app.relevantCoreServices =None
Original file line number Diff line number Diff line change @@ -14,9 +14,21 @@ import kotlin.time.Duration
1414class DesktopAppManager : AppManager {
1515
1616 private val APPS_PATH_EXP = " /Applications(/[^/]*)?/[^/]+\\ .app/Contents"
17- private val RELAVANT_CORE_SERVICES_EXP =
18- " /CoreServices(?:/[^/]*)?/(" + AppData .getRelevantCoreServices()
19- .joinToString(" |" ) + " )\\ .app/Contents"
17+ private val RELAVANT_CORE_SERVICES_EXP = when (AppData .getRelevantCoreServices().size) {
18+ 0 -> " ^#1ZAZ321D2"
19+ else -> {
20+ var res = " /CoreServices(?:/[^/]*)?/(" + AppData .getRelevantCoreServices()
21+ .joinToString(" |" ) + " )\\ .app/Contents"
22+
23+ if (AppData .getRelevantCoreServices().size == 1 ) {
24+ val l = AppData .getRelevantCoreServices()[0 ]
25+ if (l == " *" ) res = " /CoreServices(/[^/]*)?/[^/]+\\ .app/Contents"
26+ if (l == " None" ) res = " ^#1ZAZ321D2"
27+ }
28+ res
29+ }
30+ }
31+
2032
2133 override suspend fun getRunningApps (): Result <List <App >> {
2234 try {
@@ -97,7 +109,8 @@ class DesktopAppManager : AppManager {
97109 var destroyed = false
98110 if (insProcessHandleOpt.isPresent) {
99111 val insProcessHandle = insProcessHandleOpt.get()
100- destroyed = insProcessHandle.destroy()
112+ destroyed = insProcessHandle.destroy() // todo make it configurable
113+ println (destroyed)
101114 }
102115 insProcessHandleOpt to destroyed
103116 }
You can’t perform that action at this time.
0 commit comments