diff options
Diffstat (limited to 'Low Battery Yup/DaemonLauncher.m')
| -rw-r--r-- | Low Battery Yup/DaemonLauncher.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Low Battery Yup/DaemonLauncher.m b/Low Battery Yup/DaemonLauncher.m index 78b7844..355e9fd 100644 --- a/Low Battery Yup/DaemonLauncher.m +++ b/Low Battery Yup/DaemonLauncher.m @@ -42,4 +42,18 @@ return NO; } +- (BOOL)isRunning +{ + NSArray *runningApplications = [[NSWorkspace sharedWorkspace] runningApplications]; + + for (int i = 0; i < [runningApplications count]; i++) { + if ([[[runningApplications objectAtIndex:i] bundleIdentifier] + isEqualToString:@"com.teddywing.Low-Battery-Yup-d"]) { + return YES; + } + } + + return NO; +} + @end |
