Skip to content

Instantly share code, notes, and snippets.

View tao-j's full-sized avatar
🌔
總有悲歡離合

Tao Jin tao-j

🌔
總有悲歡離合
View GitHub Profile
@tao-j
tao-j / brt.m
Last active September 2, 2023 02:17
M1 External Monitor Brightness Control over DDC
@import Darwin;
@import Foundation;
@import IOKit;
// clang -fmodules -o brt brt.m && ./brt
// credit to @zhuowei for discovering the following APIs
typedef CFTypeRef IOAVServiceRef;
extern IOAVServiceRef IOAVServiceCreate(CFAllocatorRef allocator);
extern IOReturn IOAVServiceCopyEDID(IOAVServiceRef service, CFDataRef* x2);