{"id":19220415,"url":"https://github.com/louisbrunner/go-touchbar","last_synced_at":"2025-10-12T09:38:12.421Z","repository":{"id":61679896,"uuid":"550247305","full_name":"LouisBrunner/go-touchbar","owner":"LouisBrunner","description":"Go library to integrate the MacBook Touch Bar","archived":false,"fork":false,"pushed_at":"2023-12-04T18:39:05.000Z","size":1127,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-01T20:04:13.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LouisBrunner.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,"publiccode":null,"codemeta":null}},"created_at":"2022-10-12T12:45:03.000Z","updated_at":"2023-11-30T09:09:07.000Z","dependencies_parsed_at":"2023-12-04T19:59:45.041Z","dependency_job_id":null,"html_url":"https://github.com/LouisBrunner/go-touchbar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LouisBrunner/go-touchbar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LouisBrunner%2Fgo-touchbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LouisBrunner%2Fgo-touchbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LouisBrunner%2Fgo-touchbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LouisBrunner%2Fgo-touchbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LouisBrunner","download_url":"https://codeload.github.com/LouisBrunner/go-touchbar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LouisBrunner%2Fgo-touchbar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273183227,"owners_count":25059812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-09T14:35:05.105Z","updated_at":"2025-10-12T09:38:07.388Z","avatar_url":"https://github.com/LouisBrunner.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-touchbar [![Go Reference](https://pkg.go.dev/badge/github.com/LouisBrunner/go-touchbar.svg)](https://pkg.go.dev/github.com/LouisBrunner/go-touchbar)\n\nGo library to integrate the MacBook Touch Bar\n\n## Installation\n\n```bash\ngo get github.com/LouisBrunner/go-touchbar\n```\n\n## Usage\n\n```go\n// Setup your window code (including NSApplication/NSWindow on macOS)\n\ntb := touchbar.New(touchbar.Options{})\n\nerr := tb.Install(Configuration: touchbar.Configuration{\n  // Add your configuration here\n})\nif err != nil {\n  // handle\n}\n\n// run your application\n\n// when you want to update the touchbar (even from another routine), call do\nerr = tb.Update(Configuration: touchbar.Configuration{\n  // Add your updated configuration here\n})\nif err != nil {\n  // handle\n}\n\nerr = tb.Uninstall()\nif err != nil {\n  // handle\n}\n```\n\n### Configuration\n\nhttps://user-images.githubusercontent.com/7120871/197391736-450bef36-4dd6-4c79-8ae7-3bd68a932eec.mp4\n\nSee [example application](./examples/tester/main.go) for a real-life example.\n\nNote: most of the widgets are direct translations of the one in Apple's documentation and have similar options.\nPlease refer to [the official documentation](https://developer.apple.com/documentation/appkit/touch_bar/creating_and_customizing_the_touch_bar?language=objc) for more details.\n\nYou configure this library by specifying a list of items from the following options:\n\n- `Button`: a button that can be clicked (has an event handler)\n- **NOT IMPLEMENTED** `Candidates`: a list of text options, allows to give custom recommendations for the current text field\n- **NOT IMPLEMENTED** `ColorPicker`: used to choose a color (has an event handler)\n- **NOT IMPLEMENTED** `Custom`: can render anything you want, feedback any touch with a X position (has an event handler)\n- **NOT IMPLEMENTED** `Group`: used to group other items\n- `Label`: allows to display text and images\n- **NOT IMPLEMENTED** `Picker`: used to pick one or more options from a list of choices, equivalent to radio/checkbox buttons (has an event handler)\n- `Popover`: a button which shows more options when clicked, equivalent to a modal or collapse widget\n- **NOT IMPLEMENTED** `Scrubber`: allows to select items from a list, which supports scrolling (has an event handler)\n- **NOT IMPLEMENTED** `SegmentedControl`: shows multiple buttons grouped together, similar to `Picker` (has an event handler)\n- **NOT IMPLEMENTED** `Sharer`: allows to share using the standard macOS sharing system\n- `Slider`: a slider used to pick value in a range (has an event handler)\n- **NOT IMPLEMENTED** `Stepper`: a control to pick a value in a range through increments (has an event handler)\n\nBut also from this list of standard Apple widgets which have no customizable options:\n\n- `OtherItemsProxy`: where to display other Touch Bar closer to the first responder\n- `SpaceSmall`: a small space\n- `SpaceLarge`: a bigger space\n- `SpaceFlexible`: a space that grows as much as possible\n\u003c!-- - `CharacterPicker`: opens the macOS character picker (e.g. to pick an emoji)\n- `CandidateList`: shows the standard macOS predictive text widget\n- `TextFormat`: a group of text formatting options\n- `TextAlignment`: allows to pick text alignement\n- `TextColorPicker`: allows to pick text color\n- `TextList`: allows to pick text listing options\n- `TextStyle`: allows to pick text style --\u003e\n\n## Further work\n\nCheck TODO/FIXME as well\n\n- (!!!) Finish implementing widgets\n- Allow user customization (`customizationLabel`, `templateItems`, etc)\n- Layout constraints (e.g. sizing)\n- More options for widgets:\n\n  - Color-picker\n  - Custom\n  - Popover\n\n- Support standard/UI colors\n- Support custom images\n- Better validation in Go (validator on the structs?)\n- A few random crashes: `signal arrived during cgo execution` and `[touchBar itemIdentifiers] was mutated while items array was being built` (in `[WindowController setupTouchBar]`)\n\n## Acknowledgements\n\nThis library's API was influenced by [Electron's](https://www.electronjs.org/docs/latest/api/touch-bar).\n\nThe [demo application](./examples/tester/demo.go) is a reimplementation of [`electron-touch-bar`](https://github.com/pahund/electron-touch-bar).\n\nThe [catalog](./examples/tester/catalog.go) was influenced by [Apple's](https://developer.apple.com/documentation/appkit/touch_bar/creating_and_customizing_the_touch_bar?language=objc), which also helped with the Objective-C part of the implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisbrunner%2Fgo-touchbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouisbrunner%2Fgo-touchbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisbrunner%2Fgo-touchbar/lists"}