Skip to content

Instantly share code, notes, and snippets.

@kimoto
Last active April 11, 2023 03:51
Show Gist options
  • Save kimoto/6beabea7c110d0ecd38e to your computer and use it in GitHub Desktop.
Save kimoto/6beabea7c110d0ecd38e to your computer and use it in GitHub Desktop.
会社のiMacでフォーカス奪う悪質な犯人探しのためのコード
/*
* How to use:
* gcc ./find_focusyarou.m -framework AppKit
* ./a.out
*/
#import <Cocoa/Cocoa.h>
int main(){
while(1){
NSString *appName = [[[NSWorkspace sharedWorkspace] activeApplication] objectForKey:@"NSApplicationName"];
NSLog(@"%@\n", appName);
sleep(1);
}
return 0;
}
@kimoto
Copy link
Author

kimoto commented Apr 11, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment