{"id":13478112,"url":"https://github.com/cormacrelf/dark-notify","last_synced_at":"2025-06-21T17:05:41.057Z","repository":{"id":37006862,"uuid":"296274450","full_name":"cormacrelf/dark-notify","owner":"cormacrelf","description":"Watcher for macOS 10.14+ light/dark mode changes","archived":false,"fork":false,"pushed_at":"2025-05-26T00:34:58.000Z","size":4752,"stargazers_count":200,"open_issues_count":11,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-26T01:32:34.222Z","etag":null,"topics":["macos","neovim"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/cormacrelf.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}},"created_at":"2020-09-17T09:05:00.000Z","updated_at":"2025-05-26T00:28:11.000Z","dependencies_parsed_at":"2024-01-16T06:31:07.610Z","dependency_job_id":null,"html_url":"https://github.com/cormacrelf/dark-notify","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cormacrelf/dark-notify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cormacrelf%2Fdark-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cormacrelf%2Fdark-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cormacrelf%2Fdark-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cormacrelf%2Fdark-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cormacrelf","download_url":"https://codeload.github.com/cormacrelf/dark-notify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cormacrelf%2Fdark-notify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261162066,"owners_count":23118221,"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","neovim"],"created_at":"2024-07-31T16:01:52.685Z","updated_at":"2025-06-21T17:05:36.020Z","avatar_url":"https://github.com/cormacrelf.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# dark-notify\n\nIt's a program for watching when macOS switches to dark mode. Useful for making \nyour text editor switch to a dark theme. Includes a Neovim (Lua) plugin to do \nexactly that.\n\n![Demo gif](demo.gif)\n\n## Install\n\n```sh\nbrew install cormacrelf/tap/dark-notify\n```\n\n## Neovim usage\n\nRequires neovim 0.4.4 or later.\n\nAdd a plugin with your favourite plugin manager:\n\n```vim\nPlug 'cormacrelf/dark-notify'\n```\n\nThen add to your `init.vim`:\n\n```\n:lua \u003c\u003cEOF\nrequire('dark_notify').run()\nEOF\n```\n\nBy default, this will just execute `:set bg=dark` or `:set bg=light` as soon as \nthe system appearance changes.\n\n### Additional options\n\n```lua\nlocal dn = require('dark_notify')\n\n-- Configure\ndn.run({\n    schemes = {\n      -- you can use a different colorscheme for each\n      dark  = \"dark colorscheme name\",\n      -- even a different `set background=light/dark` setting or lightline theme\n      -- if you use lightline, you may want to configure lightline themes,\n      -- even if they're the same one, especially if the theme reacts to :set bg\n      light = {\n        colorscheme = \"light scheme name\",\n        background = \"override to either light or dark\",\n        lightline = \"set your lightline theme name here\"\n      }\n    },\n    lightline_loaders = {\n        -- It's tricky to get lightline to update a colorscheme for `set bg=dark`.\n        -- Add a line here to reload the config for your lightline theme.\n        my_ll_theme_name = \"path to a lightline autoload file\",\n        -- example\n        github = (vim.g.plug_home .. \"/vim-colors-github/autoload/lightline/colorscheme/github.vim\")\n    },\n    onchange = function(mode)\n        -- optional, you can configure your own things to react to changes.\n        -- this is called at startup and every time dark mode is switched,\n        -- either via the OS, or because you manually set/toggled the mode.\n        -- mode is either \"light\" or \"dark\"\n    end,\n})\n\n-- Draw the blinds for now\ndn.set_mode(\"dark\")\n\n-- Swap to whatever it isn't currently\ndn.toggle()\n\n-- Match the system\ndn.update()\n\n-- Stop reacting to changes\ndn.stop()\n\n-- Start reacting again, with previous settings\ndn.run()\n```\n\nYou can put those in mappings if you want.\n\n```vim\nnmap \u003cf5\u003e :lua require('dark_notify').toggle()\u003ccr\u003e\n```\n\n### What if I just want the toggle functionality / am not on macOS?\n\nUse the configure function instead.\n\n```vim\n:lua \u003c\u003cEOF\nrequire('dark_notify').configure({\n    -- same options as run({ ... })\n})\nEOF\n```\n\n## Command line usage\n\n```sh\n$ dark-notify\nlight\n# then System Preferences \u003e General, switch back and forth\ndark\nlight\ndark\n# ... ctrl-C to quit.\n```\n\nYou can also run another command whenever it changes:\n\n```sh\n$ dark-notify -c 'echo something'\nsomething light\nsomething dark\n$ dark-notify -c 'python3 my-script.py'\n```\n\n`dark-notify -h` for more options.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcormacrelf%2Fdark-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcormacrelf%2Fdark-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcormacrelf%2Fdark-notify/lists"}