{"id":15813818,"url":"https://github.com/bra1ndump/kill-my-mac","last_synced_at":"2025-06-18T11:36:53.255Z","repository":{"id":233178121,"uuid":"786227489","full_name":"bra1nDump/kill-my-mac","owner":"bra1nDump","description":"Sick and tired of staying up late because of your mac? Schedule it to be shutdown during sleep hours","archived":false,"fork":false,"pushed_at":"2024-06-28T20:35:41.000Z","size":1270,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T23:51:24.269Z","etag":null,"topics":["discipline","health","mac","routine","schedule","sleep","wind-down"],"latest_commit_sha":null,"homepage":"https://bra1ndump.com/blog/product-kill-pc-at-12","language":"Shell","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/bra1nDump.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-04-13T20:00:45.000Z","updated_at":"2024-06-28T20:35:45.000Z","dependencies_parsed_at":"2024-10-26T09:47:49.477Z","dependency_job_id":"8014cdc0-84c4-4b70-bf28-85b3338997f3","html_url":"https://github.com/bra1nDump/kill-my-mac","commit_stats":null,"previous_names":["bra1ndump/kill-my-mac-at-12am","bra1ndump/kill-my-mac"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bra1nDump%2Fkill-my-mac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bra1nDump%2Fkill-my-mac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bra1nDump%2Fkill-my-mac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bra1nDump%2Fkill-my-mac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bra1nDump","download_url":"https://codeload.github.com/bra1nDump/kill-my-mac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246670359,"owners_count":20814970,"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":["discipline","health","mac","routine","schedule","sleep","wind-down"],"created_at":"2024-10-05T04:06:20.685Z","updated_at":"2025-04-01T16:30:30.990Z","avatar_url":"https://github.com/bra1nDump.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kill my mac, let me sleep\nAre you sick and tired of **staying up late because of your mac?** This script suggests you to wind down using customizable voice annoucements. If your mac is still on during sleep hours - **this script will shut your mac down for you.** You are welcome.\n\n## How it works\n- Your computer will be shut down during hours **12am - 6am**\n- 2.5hr, 1hr, and 10 minutes before the sleep hours start the computer will warn you, if your sound is on\n- Open an issue if you want customizable sleep hours, for now edit the [shutdown-job.sh](./shutdown-job.sh)\n\n## How to install:\n\n\u003e Warning: Before you install, please understand that it might be hard to turn the computer back on during sleep hours. Every time the computer is turned on, you will have 1 minute to disable it from shutting down your computer.\n\nIn your terminal run:\n\n```bash\necho \"Cloning the repo\"\ngit clone https://github.com/bra1nDump/kill-my-mac.git\ncd kill-my-mac\n\necho \"Setting up\"\n./install.sh\n```\n\n## How to make sure it works correctly?\nTODO: Currently you can change the sleep hours to be closer to current time in the [shutdown-job.sh](./shutdown-job.sh) script. You can also change the warning times.\n\n## I want a more agressive version!\nI got you! How agressive?\n- To make sure I get asked for the password / touch id after every sleep - search in System Settings for Lock Screen and set to 'Immediately' ![](./tutorial-find-lock-screen-immedeately.png)\n- To make the computer shut down instead of sleeping, uncomment piece of [shutdown-job.sh](./shutdown-job.sh), this line: `osascript -e 'tell application \"System Events\" to shut down'`\n\n## How to uninstall?\nYou can do either option:\n- In terminal run `rm ~/Library/LaunchAgents/com.bra1ndump.kill-my-mac.plist`, this will prevent the script from running. You can run `./install.sh` to enable again\n- In the directory where you cloned the project run `./uninstall.sh`. Same as above.\n- Open the [shutdown-job.sh](./shutdown-job.sh) script where you installed this project and comment out the last if statement that has this line: `osascript -e 'tell application \"System Events\" to shut down'`. Uncomment it again to re-enable\n\n## How does it actually work?\n- It installs a [LaunchAgent](./templates/com.bra1ndump.shutdown-during-sleep-hours.plist) that runs shutdown-job every minute\n  - You can find the agent configuration here `ls ~/Library/LaunchAgents`\n- [shutdown-job.sh](./shutdown-job.sh)\n  - If computer is already asleep (uses `pmset`), do nothing\n  - If close to sleep hours, warns the user\n  - If in sleep hours, shut down using apple script `osascript -e 'tell application \"System Events\" to shut down'`\n\n# TODO:\n\n- Post about it\n- TELL MY FRIENDS TO TRY IT\n\n# Later:\n- Package with Homebrew tap\n  - More user trust because of the brew prefix\n  - Easier upgrading (not sure if the taps get auto-upgraded though)\n\n- Allow configuring sleep time - will need to symlink the cli bash script that will update the configurations so its accessible from anywhere\n  - Prompted:\n    - Choose a time when you want to ensure your computer is not running\n    - Format is: 00:20-06:00, no spaces, period start, period end, 24 hr format\n    - In this example starting at 20 past midnight until 6, if your computer is not asleep, it will be forcefully shut down\n  - Enter the time - default is 00:00-06:00 (midnight until 6am): Get\n\n- How can I make editing the configuration difficult?\n- By allowing to skip the shutdown once by looking at a message to self you wrote when setting this up, and forcing to look at it for 5 minutes before allowing to skip\n\n- Maybe switch to python? Since it will be installed by brew, I can just set python as a dependency. Its installed everywhere already so does not really matter. Bash is fucking ridiculous. Functions are unlike in any other programming language\n\n# Alternatives:\n- Work on the discipline in other ways\n- `pmset repeat shutdown TWRFS 11:00:00`\n- Almighty https://indiegoodies.com/almighty - many different shortcuts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbra1ndump%2Fkill-my-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbra1ndump%2Fkill-my-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbra1ndump%2Fkill-my-mac/lists"}