From f82b96978302bb015e919f7ef46e77de5a733a86 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 31 Dec 2024 12:25:19 -0500 Subject: [PATCH] Make ghostty colors respond to system settings --- install.sh | 2 +- nvim/.config/nvim/lazy-lock.json | 9 +++++---- nvim/.config/nvim/lua/plugins/auto-dark-mode.lua | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 nvim/.config/nvim/lua/plugins/auto-dark-mode.lua diff --git a/install.sh b/install.sh index 6ba2e61..9c185fa 100755 --- a/install.sh +++ b/install.sh @@ -235,7 +235,7 @@ install_env() { } install_stow_paths() { - stow alacritty bin git nvim ruby tmux zsh + stow alacritty bin ghostty git nvim ruby tmux zsh } install_linux() { diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index d0adf0c..99272dc 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,17 +1,18 @@ { + "auto-dark-mode.nvim": { "branch": "master", "commit": "4531f8b2b09ed8f0b8875a706419f9cecda1d969" }, "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, "git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" }, "git-messenger.vim": { "branch": "master", "commit": "edc603d4cda7894a743e383e16c638e206d03148" }, "gitlinker.nvim": { "branch": "master", "commit": "a221c13fc3c7f5b8799933f4966ee8e618287292" }, - "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, + "gitsigns.nvim": { "branch": "main", "commit": "ee7634ab4f0a6606438fe13e16cbf2065589a5ed" }, "gruvbox": { "branch": "master", "commit": "143a3b8babcfd2bce6c99d6ba496942647c3e30b" }, - "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, + "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "telescope.nvim": { "branch": "master", "commit": "dc6fc321a5ba076697cca89c9d7ea43153276d81" }, + "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, "typescript-vim": { "branch": "master", "commit": "8d169e16b5487771f6568125d4c63e6086e524d9" }, - "vim-eunuch": { "branch": "master", "commit": "8fb3904be27b6b60d086f87c2570085902414069" }, + "vim-eunuch": { "branch": "master", "commit": "6c6af39aa0a25223389607338ae965c5dfc7c972" }, "vim-go": { "branch": "master", "commit": "ac1fb9611de435d80a6badcf8482cb1428449b10" }, "vim-markdown": { "branch": "master", "commit": "f405b47fd8774ecd5e808e6de9c85d9029da251c" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, diff --git a/nvim/.config/nvim/lua/plugins/auto-dark-mode.lua b/nvim/.config/nvim/lua/plugins/auto-dark-mode.lua new file mode 100644 index 0000000..4030de8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/auto-dark-mode.lua @@ -0,0 +1,16 @@ +return { + "f-person/auto-dark-mode.nvim", + opts = { + update_interval = 3000, + set_dark_mode = function() + -- vim.api.nvim_set_option_value("background", "dark", {}) + vim.opt.background = "dark" + -- vim.cmd("colorscheme gruvbox") + end, + set_light_mode = function() + vim.api.nvim_set_option_value("background", "light", {}) + vim.opt.background = "light" + -- vim.cmd("colorscheme gruvbox") + end, + }, +}