Last active
April 11, 2023 03:51
-
-
Save kimoto/6beabea7c110d0ecd38e to your computer and use it in GitHub Desktop.
会社のiMacでフォーカス奪う悪質な犯人探しのためのコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
コメント記法が間違ってたので修正 (9年ぶり)
https://gist.github.com/kimoto/6beabea7c110d0ecd38e/revisions#diff-280ab0b3349b31542dc009a8bd5085333af12515693fb279188ecd8f578b9dbeL1