Skip to content

help setting up an auto update lualine feature #38

@brunobmello25

Description

@brunobmello25

Trying to setup an update function to update lualine on theme change. Something like this:

_G.UpdateLualine = function()
  local themery = require 'themery'
  local currentTheme = themery.getCurrentTheme()

  require('lualine').setup { options = { theme = currentTheme and currentTheme.name or 'tokyonight' } }
end

return {
  {
    'zaldih/themery.nvim',
    lazy = false,
    priority = 1000,
    dependencies = {
      { 'ellisonleao/gruvbox.nvim' },
      { 'folke/tokyonight.nvim' },
    },
    config = function()
      require('themery').setup {
        themes = { 'tokyonight', 'gruvbox' },
        globalAfter = [[lua UpdateLualine()]],
      }
    end,
  },
}

but for some reason this function is not being called, either because it's not recognized inside this scope, or some other reason. any tips on how to make this work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions