{"id":41129163,"url":"https://github.com/miquels/macbook-fix-touchbar","last_synced_at":"2026-01-22T18:19:46.649Z","repository":{"id":221219900,"uuid":"753765404","full_name":"miquels/macbook-fix-touchbar","owner":"miquels","description":"Workaround for macbooks rebooting because the touchbar got hung","archived":false,"fork":false,"pushed_at":"2024-02-07T18:58:04.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-22T01:55:32.513Z","etag":null,"topics":["controlstrip","crash","fix","macos","touchbar"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miquels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-06T18:48:42.000Z","updated_at":"2024-02-07T18:06:12.000Z","dependencies_parsed_at":"2024-02-06T20:38:56.995Z","dependency_job_id":null,"html_url":"https://github.com/miquels/macbook-fix-touchbar","commit_stats":null,"previous_names":["miquels/macbook-fix-touchbar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/miquels/macbook-fix-touchbar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquels%2Fmacbook-fix-touchbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquels%2Fmacbook-fix-touchbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquels%2Fmacbook-fix-touchbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquels%2Fmacbook-fix-touchbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miquels","download_url":"https://codeload.github.com/miquels/macbook-fix-touchbar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquels%2Fmacbook-fix-touchbar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28667925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["controlstrip","crash","fix","macos","touchbar"],"created_at":"2026-01-22T18:19:46.130Z","updated_at":"2026-01-22T18:19:46.631Z","avatar_url":"https://github.com/miquels.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# macbook-fix-touchbar\n\nWorkaround for macbooks rebooting because the touchbar got hung.\n\nOn macbooks with a touch bar, sometimes the hardware of the touchbar\nwill get confused and fail to respond. Usually you'll also see the\ntouch bar flashing, or going completely black.\n\nAfter 180 seconds the macos `watchdogd` will then conclude that there is\na fatal hardware problem, and crash/reboot the system.\n\nThere are 2 curious facts about this problem:\n- it doesn't happen while you're typing / using the touchpad\n- killing the `TouchBarServer` resets the hardware _and the watchdog_\n\nSo the `fix-touchbar` script runs in the background, and every few seconds\nit checks:\n\n- are we idle more than 60 seconds (not typing etc)\n- in that case, restart the TouchBarServer process once a minute.\n  (note that we _also_ restart the `ControlStrip` process for good measure)\n\nThis seems to work. Most of the time, at least.\n\n\n## Install:\n\nFor a script that runs as a normal user to be able to kill the (root) `TouchBarServer`\nprocess, you need to add a line to the end of the _User Specification_ part of\nthe `/etc/sudoers` file. You can do this by running `visudo` **as root** and adding this:\n\n```\nALL             ALL=(root) NOPASSWD: /usr/bin/pkill -x TouchBarServer\n```\n\nNote that this will enable any user on the macbook to issue the command\n`sudo pkill -x TouchBarServer` - which should not really be a problem.\n\nThen, run these commands (as yourself, **not as root**) to install the script to run as a daemon:\n\n```\ncp fix-touchbar ~/Library/Scripts\nchmod 755 ~/Library/Scripts/fix-touchbar\ncp nl.z42.FixTouchBar.plist ~/Library/LaunchAgents/\nchmod 644 ~/Library/LaunchAgents/nl.z42.FixTouchBar.plist\nlaunchctl enable gui/$UID/nl.z42.FixTouchBar\nlaunchctl start nl.z42.FixTouchBar\n```\n\n## Uninstall:\n\nRun these commands as a normal user:\n\n```\nlaunchctl stop nl.z42.FixTouchBar\nlaunchctl disable gui/$UID/nl.z42.FixTouchBar\nrm ~/Library/Scripts/fix-touchbar ~/Library/LaunchAgents/nl.z42.FixTouchBar.plist\n```\n\nThen run `visudo` as root to remove the `pkill` line from the sudoers file.\n\n\n\nGood luck!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiquels%2Fmacbook-fix-touchbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiquels%2Fmacbook-fix-touchbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiquels%2Fmacbook-fix-touchbar/lists"}