{"id":15031008,"url":"https://github.com/madsmtm/menhue","last_synced_at":"2025-07-05T11:36:54.337Z","repository":{"id":255405195,"uuid":"849513126","full_name":"madsmtm/menhue","owner":"madsmtm","description":"Status bar interface for Phillips Hue lights","archived":false,"fork":false,"pushed_at":"2025-04-14T03:24:29.000Z","size":64,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T03:04:49.387Z","etag":null,"topics":["macos","objc2","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madsmtm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-29T18:12:01.000Z","updated_at":"2025-04-14T03:24:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f51a1ec-7e39-426a-9d72-0fcc5a15a046","html_url":"https://github.com/madsmtm/menhue","commit_stats":null,"previous_names":["madsmtm/menhue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/madsmtm/menhue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madsmtm%2Fmenhue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madsmtm%2Fmenhue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madsmtm%2Fmenhue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madsmtm%2Fmenhue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madsmtm","download_url":"https://codeload.github.com/madsmtm/menhue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madsmtm%2Fmenhue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261837582,"owners_count":23217458,"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","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":["macos","objc2","rust","rust-lang"],"created_at":"2024-09-24T20:14:43.492Z","updated_at":"2025-06-25T08:38:49.055Z","avatar_url":"https://github.com/madsmtm.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Menhue - Status bar interface for Phillips Hue lights\n\nMostly an open-source clone of https://huemenu.app/, but without the (IMO) excessive polling it does to always be up to date. Starting a request on click is enough to feel interactive.\n\nVery feature-incomplete and work-in-progress, don't actually use this for anything other than inspiration for how to use [`objc2`](https://docs.rs/objc2/).\n\n\n## Design decisions\n\nUses only Cocoa APIs, to get a feel for what that's like.\n\nIn a real-world application, I'd strongly recommend `serde` and `serde_json` for interacting with JSON data, and `reqwest` for doing the URL requests.\n\n\n## Future ideas\n\n- Integrate with `AppIntents`, and support Siri, automations, and so on.\n- Actually, maybe let the automations be written in Automator itself, and then parse those, and send them to the lamp in a fashion it understands?\n- Maybe all of this can be done by integrating with `HomeKit`?\n- `SensorKit` for ambient light?\n  - Or: https://stackoverflow.com/questions/17625495/how-do-you-programmatically-access-the-ambient-light-sensor-on-mac-os-x-10-5\n  - https://github.com/insidegui/DarkModeBuddy\n- Use https://developer.apple.com/documentation/systemconfiguration/1514895-scnetworkreachabilitycreatewitha?language=objc (or the equivalent from the Network framework)\n- See also https://developer.apple.com/documentation/widgetkit?language=objc\n\n\n## Notes\n\nDetecting `mouseEntered:`/`mouseExited:` for status bar buttons is not possible, even with replacing the class.\n\nOld API docs: https://developers.meethue.com/develop/hue-api/, https://www.burgestrand.se/hue-api/\nDeveloper: https://$HOST/debug/clip.html\n\n\n## State machine WIP\n\n```mermaid\nflowchart TD;\n  Init--\u003eDataFromCache;\n\n  DataFromCache[Getting data from cache...]\n  DataFromCache-- Failure --\u003eLoginDialog;\n  DataFromCache-- Success --\u003eMenuReady;\n\n  LoginDialog[[Show login dialog]]\n  LoginDialog-- Log in with details --\u003eFetchUser;\n\n  FetchUser[Logging in...]\n  FetchUser-- Failure --\u003eLoginDialog;\n  FetchUser-- Success --\u003eMenuReady;\n\n  MenuReady[[Menu ready]]\n  MenuReady-- On open --\u003eFetchLampStatus;\n\n  FetchLampStatus[Fetching lamp status...]\n  FetchLampStatus-- Permission error --\u003eLoginDialog2;\n  LoginDialog2[[Show login dialog]]\n  FetchLampStatus-- Failure --\u003eMenuOpenWithError;\n  FetchLampStatus-- Success --\u003eMenuOpen;\n\n  MenuOpenWithError[[Show error in menu]]\n  MenuOpenWithError-- Retry --\u003eFetchLampStatus;\n  MenuOpenWithError-- Close --\u003eMenuReady;\n\n  MenuOpen[[Show lamps]]\n  MenuOpen-- Edit Lamp --\u003eEditLamp;\n  MenuOpen-- Close --\u003eMenuReady;\n\n  EditLamp[Editing lamp...]\n  EditLamp-- Permission error --\u003eLoginDialog3;\n  LoginDialog3[[Show login dialog]]\n  EditLamp-- Failure --\u003eMenuOpenWithError;\n  EditLamp-- Success --\u003eMenuOpen;\n```\n\n## Nix\n\n```nix\n# darwin-configuration.nix\n{\n  imports = [ menhue/service.nix ];\n\n  services.menhue = {\n    enable = true;\n    host = \"...\";\n    username = \"...\";\n  };\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadsmtm%2Fmenhue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadsmtm%2Fmenhue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadsmtm%2Fmenhue/lists"}