{"id":16768019,"url":"https://github.com/bouk/dark-mode-notify","last_synced_at":"2025-05-12T04:30:40.249Z","repository":{"id":44461630,"uuid":"336787508","full_name":"bouk/dark-mode-notify","owner":"bouk","description":"Run a script whenever dark mode changes in macOS","archived":false,"fork":false,"pushed_at":"2022-09-14T14:29:20.000Z","size":10,"stargazers_count":203,"open_issues_count":6,"forks_count":33,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-01T00:11:23.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/bouk.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}},"created_at":"2021-02-07T13:00:08.000Z","updated_at":"2025-03-09T09:25:27.000Z","dependencies_parsed_at":"2022-08-29T11:11:25.423Z","dependency_job_id":null,"html_url":"https://github.com/bouk/dark-mode-notify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bouk%2Fdark-mode-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bouk%2Fdark-mode-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bouk%2Fdark-mode-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bouk%2Fdark-mode-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bouk","download_url":"https://codeload.github.com/bouk/dark-mode-notify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675071,"owners_count":21945892,"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":[],"created_at":"2024-10-13T06:10:34.909Z","updated_at":"2025-05-12T04:30:39.974Z","avatar_url":"https://github.com/bouk.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dark-mode-notify\n\nThis small Swift program will run a command whenever the dark mode status changes on macOS. You can use it to change your vim color config automatically for example.\n\n## Usage\n\nUse make to compile the program, then run directly:\n\n```shell\n.build/release/dark-mode-notify \u003cyour-program\u003e\n```\n\nAlternatively you can install it by doing `make install`.\n\nThe program will be run immediately when the command starts, and every time the OS goes from dark mode to light mode or back. The environment variable `DARKMODE` will be set to either `1` or `0`.\n\n## Background agent\n\nTo keep this program running in the background, compile the binary to somewhere and create the following file at `~/Library/LaunchAgents/ke.bou.dark-mode-notify.plist`. Don't forget to replace the arguments and the path to the logs (which comes in handy for debugging)\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\"\n\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"\u003e\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n    \u003ckey\u003eLabel\u003c/key\u003e\n    \u003cstring\u003eke.bou.dark-mode-notify\u003c/string\u003e\n    \u003ckey\u003eKeepAlive\u003c/key\u003e\n    \u003ctrue/\u003e\n    \u003ckey\u003eStandardErrorPath\u003c/key\u003e\n    \u003cstring\u003e----Path to a location----/dark-mode-notify-stderr.log\u003c/string\u003e\n    \u003ckey\u003eStandardOutPath\u003c/key\u003e\n    \u003cstring\u003e----Path to a location----/dark-mode-notify-stdout.log\u003c/string\u003e\n    \u003ckey\u003eProgramArguments\u003c/key\u003e\n    \u003carray\u003e\n       \u003cstring\u003e/usr/local/bin/dark-mode-notify\u003c/string\u003e\n       \u003cstring\u003e--- Path to your script ---\u003c/string\u003e\n    \u003c/array\u003e\n\u003c/dict\u003e\n\u003c/plist\u003e\n```\n\nThen `launchctl load -w ~/Library/LaunchAgents/ke.bou.dark-mode-notify.plist` will keep it running on boot.\n\n## Credit\n\nThis script is a lightly modified version of https://github.com/mnewt/dotemacs/blob/master/bin/dark-mode-notifier.swift\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbouk%2Fdark-mode-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbouk%2Fdark-mode-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbouk%2Fdark-mode-notify/lists"}