Skip to content

mktip/adaptive-theme.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

adaptive-theme.nvim

Change your Neovim theme based on the current system theme preference (light/dark)

Dependences

This plugin requires ldbus from luarocks

luarocks install ldbus --lua-version 5.1 --local --server https://luarocks.org/dev/ DBUS_ARCH_INCDIR=/usr/lib64/dbus-1.0/include/ DBUS_INCDIR=/usr/include/dbus-1.0/

Note

You may need to change the paths to the dbus include directories

Usage

On Lazy.nvim

{ 
  "mktip/adaptive-theme.nvim", 
  opts = { 

    -- The function that will be called when the system theme preference changes
    theme_handler = function(background) 
      if background == "none" then 
        return
      end

      vim.o.background = background
      if background == "dark" then
        vim.cmd [[colorscheme your_prefered_dark_theme]]
      else
        vim.cmd [[colorscheme your_prefered_light_theme]]
      end
    end
  }
},

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages