{"id":41692803,"url":"https://github.com/mishamyrt/lidoff","last_synced_at":"2026-05-14T00:02:32.221Z","repository":{"id":334435380,"uuid":"1141362064","full_name":"mishamyrt/lidoff","owner":"mishamyrt","description":"💡 Third state for the MacBook lid","archived":false,"fork":false,"pushed_at":"2026-05-13T18:48:53.000Z","size":470,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-13T20:30:53.230Z","etag":null,"topics":["automation","daemon","macos"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/mishamyrt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-24T18:11:22.000Z","updated_at":"2026-03-12T07:21:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mishamyrt/lidoff","commit_stats":null,"previous_names":["mishamyrt/lidoff"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mishamyrt/lidoff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Flidoff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Flidoff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Flidoff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Flidoff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mishamyrt","download_url":"https://codeload.github.com/mishamyrt/lidoff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Flidoff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33004768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: 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":["automation","daemon","macos"],"created_at":"2026-01-24T20:24:10.793Z","updated_at":"2026-05-14T00:02:32.215Z","avatar_url":"https://github.com/mishamyrt.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./docs/logo.svg\" alt=\"lidoff logo\" height=\"141\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/mishamyrt/lidoff/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/mishamyrt/lidoff/actions/workflows/build.yml/badge.svg\" alt=\"Build status\"\u003e\u003c/a\u003e\n    \u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"MIT license\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`lidoff` is a macOS daemon for Apple Silicon MacBooks. It watches the lid angle, turns off the built-in display and keyboard backlight when the lid is partially closed, disables external displays, and keeps the machine awake with `caffeinate`.\n\n## Why\n\n`lidoff` is useful when you want the MacBook to keep working with the lid nearly closed:\n\n- Run a long refactoring or LLM coding session while you step away.\n- Keep audio playing without lighting the room.\n- Leave a download, build, or sync running overnight.\n\nThe idea is to add a middle state between \"open\" and \"closed\": when the lid is only partially closed, the laptop stays awake but the displays and keyboard backlight are dimmed to zero.\n\n## Features\n\n- Reads the MacBook lid angle instead of relying only on open/closed state.\n- Dims the built-in display and keyboard backlight to zero when the lid is partially closed.\n- Starts a `caffeinate` session while the partial-close state is active.\n- Restores saved brightness values when the lid opens or fully closes.\n- Disables and restores external displays when possible.\n- Installs as a per-user macOS LaunchAgent.\n\n## Requirements\n\n- MacBook Air or MacBook Pro with Apple Silicon (M2, M3, or M4).\n- macOS with access to the built-in lid angle sensor.\n\n## Installation\n\n### Homebrew\n\n```bash\nbrew install mishamyrt/tap/lidoff\nlidoff install\n```\n\n### Quick Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/mishamyrt/lidoff/master/install.sh | bash\nlidoff install\n```\n\nThe quick installer places the binary in `~/.local/bin`. Make sure that directory is in your `PATH`.\n\n### From Source\n\n```bash\ngit clone https://github.com/mishamyrt/lidoff.git\ncd lidoff\nrustup toolchain install stable\ncargo build --release --package lidoff\nmkdir -p \"$HOME/.local/bin\"\ninstall -m 755 target/release/lidoff \"$HOME/.local/bin/lidoff\"\nlidoff install\n```\n\n## Usage\n\n```text\nlidoff [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  install    Install service as launch agent\n  uninstall  Uninstall service's launch agent\n  run        Start the monitor in the foreground\n\nOptions:\n  -t, --threshold \u003cdegrees\u003e  Lid angle threshold in range 10-60 degrees [default: 30]\n  -i, --interval \u003cms\u003e        Polling interval in ms in range 50-5000 ms [default: 300]\n  -v, --verbose              Log current lid angle\n  -h, --help                 Print help\n  -V, --version              Print version\n```\n\nOptions are global and must be passed before the command:\n\n```bash\n# Run in the foreground with default settings\nlidoff run\n\n# Run in the foreground and print lid angle updates\nlidoff --verbose run\n\n# Install LaunchAgent with a custom threshold and polling interval\nlidoff --threshold 25 --interval 500 install\n\n# Remove the LaunchAgent\nlidoff uninstall\n```\n\n## Behavior\n\n`lidoff` classifies lid angle into three states:\n\n- **Partially closed**: `5° \u003c= angle \u003c threshold`. Saves current brightness values, dims the built-in display and keyboard backlight to zero, disables external displays when possible, and starts `caffeinate`.\n- **Open**: `angle \u003e= threshold`. Restores saved brightness values, restores external displays, and stops `caffeinate`.\n- **Fully closed**: `angle \u003c 5°`. Restores saved brightness values, restores external displays, and stops `caffeinate`, allowing normal sleep behavior.\n\nExternal display shutdown uses the available macOS display controls and falls back where possible. Some monitors or connection types may not support full external brightness control.\n\n## Development\n\nThe project is a Rust workspace under `crates/`:\n\n- `crates/lidoff` contains the CLI and LaunchAgent integration.\n- `crates/lidoff-daemon` contains monitor state management and runtime orchestration.\n- `crates/lidoff-display`, `crates/lidoff-lidsensor`, and `crates/lidoff-power` contain macOS integration shims.\n\nUseful commands:\n\n```bash\ncargo build --workspace\nmake fmt\nmake lint\nmake test\nmake check\n```\n\nDevelopment tools:\n\n```bash\nbrew install llvm\nrustup component add rustfmt clippy\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Flidoff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmishamyrt%2Flidoff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Flidoff/lists"}