{"id":15402415,"url":"https://github.com/pirj/noclamshell","last_synced_at":"2025-05-15T22:11:13.843Z","repository":{"id":42207661,"uuid":"72051276","full_name":"pirj/noclamshell","owner":"pirj","description":"Sleep despite annoying clamshell mode","archived":false,"fork":false,"pushed_at":"2025-05-07T10:43:40.000Z","size":21,"stargazers_count":510,"open_issues_count":0,"forks_count":18,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-07T11:35:58.288Z","etag":null,"topics":["clamshell-mode","macos"],"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/pirj.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":"2016-10-26T22:54:53.000Z","updated_at":"2025-05-07T10:43:43.000Z","dependencies_parsed_at":"2024-12-07T15:01:59.071Z","dependency_job_id":null,"html_url":"https://github.com/pirj/noclamshell","commit_stats":{"total_commits":21,"total_committers":4,"mean_commits":5.25,"dds":"0.23809523809523814","last_synced_commit":"59664ba01aea4aae91c926e77abbf2eaa11c5c36"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fnoclamshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fnoclamshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fnoclamshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fnoclamshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirj","download_url":"https://codeload.github.com/pirj/noclamshell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254430331,"owners_count":22069909,"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":["clamshell-mode","macos"],"created_at":"2024-10-01T16:03:06.822Z","updated_at":"2025-05-15T22:11:13.819Z","avatar_url":"https://github.com/pirj.png","language":"Shell","readme":"Tired of the annoying iOS clamshell mode when MacBook doesn't go to sleep when you close the lid with an external monitor connected?\n\nUse this!\n\nKnown to work on on Apple Silicon macs, and older Intel macs. No issues for years.\n\n# No clamshell mode\n\nWhat is a clamshell mode? As per [this doc](https://support.apple.com/en-us/HT201834):\n\n\u003e You can use an external display or projector with a Mac notebook while its built-in display is closed. This is known as \"closed-clamshell\" or \"closed-display\" mode.\n\nBasically, when you're connected with power adapter and there's an external monitor connected, when you close the lid, nothing happens.\n\nBut this mode doesn't fit all, and there's still no good solution, and there is no option to turn it off in settings. Some tricks exist, none of them gets you a sleeping machine when just closing the lid:\n\n  - unplug power adapter, close lid, plug power back;\n  - close lid, unplug power adapter, plug power back;\n  - before closing the lid, press power button (actually long-press it and then click on \"Sleep\");\n  - put external display off using a hot corner, close lid\n\nSome discussion threads [from](https://discussions.apple.com/thread/3196000) [back](http://forums.macrumors.com/threads/clamshell-mode-vs-sleep.1468082/) [then](http://apple.stackexchange.com/questions/18037/why-wont-closing-the-lid-sleep-my-macbook-pro-with-external-monitor-attached-af) [and](http://apple.stackexchange.com/questions/19932/force-macbook-to-sleep-when-lid-closed-and-external-monitor-connected-in-lion) [pretty](http://apple.stackexchange.com/questions/90692/turn-off-both-displays-when-in-clamshell-mode) [recent](http://apple.stackexchange.com/questions/152777/how-to-disable-clamshell-mode-in-yosemite) [as well](http://superuser.com/questions/797755/disable-clamshell-mode-in-os-x-mountain-lion).\n\n## Less fuss\n\nImagine a magic script that monitors your lid state, and when it is closed, puts your machine to sleep.\nHere it is!\n\n## How does this work\n\nIt periodically checks if lid is closed and puts machine to sleep. Nothing fancy, it uses command line tools that come with OSX, specifically `ioreg`, which displays I/O registry and `pmset` to manipulate power management settings.\n\n## Installation\n\nUsing [a custom tap](https://github.com/pirj/homebrew-noclamshell):\n\n    brew install pirj/noclamshell/noclamshell\n    brew services start noclamshell\n\n## Uninstall\n\nIn case utility didn't work as you expected, you can turn it off:\n\n    brew services stop noclamshell\n    brew uninstall pirj/noclamshell/noclamshell\n\nPlease drop me a note on what went wrong!\n\n## Self-ad\n\nI also maintain [an utility that reduces the brightness of internal display](https://github.com/pirj/nobacklight) to zero when lid is open. Appreciate if you check it out!\n\n## Blah\n\nAuthor: Phil Pirozhkov\n\nContributors:\n - Claus F. Strasburger [@cfstras](https://github.com/cfstras)\n - Ben Bosman [@benbosman](https://github.com/benbosman)\n - Ilya Rodionov [@ris58h](https://github.com/ris58h)\n\nLicense: MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirj%2Fnoclamshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirj%2Fnoclamshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirj%2Fnoclamshell/lists"}