{"id":21343150,"url":"https://github.com/rancorm/nvim-aqua","last_synced_at":"2025-04-15T03:40:39.775Z","repository":{"id":220725400,"uuid":"751428605","full_name":"rancorm/nvim-aqua","owner":"rancorm","description":"Neovim plugin to detect macOS appearance change","archived":false,"fork":false,"pushed_at":"2024-12-25T23:35:33.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T15:12:07.338Z","etag":null,"topics":["appearance","dark-mode","light-mode","macos","neovim","neovim-plugin","terminal"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rancorm.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":"2024-02-01T15:41:08.000Z","updated_at":"2025-01-01T15:34:39.000Z","dependencies_parsed_at":"2024-12-26T03:00:21.470Z","dependency_job_id":null,"html_url":"https://github.com/rancorm/nvim-aqua","commit_stats":null,"previous_names":["rancorm/nvim-aqua"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fnvim-aqua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fnvim-aqua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fnvim-aqua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fnvim-aqua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rancorm","download_url":"https://codeload.github.com/rancorm/nvim-aqua/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003935,"owners_count":21196794,"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":["appearance","dark-mode","light-mode","macos","neovim","neovim-plugin","terminal"],"created_at":"2024-11-22T01:12:13.889Z","updated_at":"2025-04-15T03:40:39.468Z","avatar_url":"https://github.com/rancorm.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nvim-aqua\n\nNeovim plugin to detect macOS appearance change. I use it with themes and\nother plugins that observe `background`, like with [Monokai NighTasty](https://github.com/polirritmico/monokai-nightasty.nvim) and some of the [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) themes.\n\n\u003e [!NOTE]\n\u003e There is a linking issue with Swift scripts on macOS Sonoma. The workaround\n\u003e requires the Xcode toolchain, sorry.\n\n## Install and Setup\n\nInstall using your favourite Neovim package manager. What my [lazy.nvim](https://github.com/folke/lazy.nvim) plugin config\nlooks like:\n\n```lua\nreturn {\n  \"rancorm/nvim-aqua\",\n  lazy = false, -- Make sure to load this plugin during startup\n  priority = 1000, -- Make sure to load this before all other start plugins\n  version = \"0.x\",\n  config = function()\n    require(\"nvim-aqua\").setup {\n      change = function(value)\n        -- Note the comparison is done with a string not an integer\n        if value == \"1\" then\n          -- Light\n          vim.opt.background = \"light\"\n        else\n          -- Dark\n          vim.opt.background = \"dark\"\n        end\n      end\n    }\n  end\n}\n```\n\nOr if you would like, you can use the `light` and `dark` functions.\n\n```lua\nreturn {\n  \"rancorm/nvim-aqua\",\n  lazy = false, -- Make sure to load this plugin during startup\n  priority = 1000, -- Make sure to load this before all other start plugins\n  version = \"0.x\",\n  config = function()\n    require(\"nvim-aqua\").setup {\n      light = function()\n        vim.opt.background = \"light\"\n      end,\n      dark = function()\n        vim.opt.background = \"dark\"\n      end\n    }\n  end\n}\n```\n\n## Observer\n\nThe plugin includes a Swift script, [observer.swift](scripts/observer.swift), designed to monitor macOS\nappearance changes.\n\nThe script is triggered under specific conditions (e.g., on\nstartup or during certain events) and outputs either `1` (light mode) or `0` (dark mode)\nto standard output when changes are detected.\n\nThe Lua component of the plugin is responsible for launching the Swift script and\nemploys a callback mechanism to handle the script's output. The callback function\nreceives the value (1 or 0) and passes it to a user-defined function, allowing users\nto incorporate the information as needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Francorm%2Fnvim-aqua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Francorm%2Fnvim-aqua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Francorm%2Fnvim-aqua/lists"}