Skip to content

Instantly share code, notes, and snippets.

@kachidk
Forked from smosko/TouchBarFix.scpt
Created December 16, 2024 06:14
Show Gist options
  • Save kachidk/3ac170d5e5d8f5812f05608ac459c8fc to your computer and use it in GitHub Desktop.
Save kachidk/3ac170d5e5d8f5812f05608ac459c8fc to your computer and use it in GitHub Desktop.
Macbook Pro TouchBar Flicker Fix
# 1. Paste this into Script Editor, replace username and password;
# 2. Export as "Application", check "Stay open" and "Run-only";
# 3. Add to Login Items in Settings/General to run automatically;
# 4. To hide the Dock icon, add to Content/Info.plist:
# <key>LSUIElement</key>
# <string>1</string>
on idle
set idleTime to (do shell script "ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print $NF/1000000000; exit}'") as integer
if idleTime is less than 58 then
return 58 - idleTime
end if
do shell script "pkill TouchBarServer" user name "*****" password "*****" with administrator privileges
return 58
end idle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment