Skip to content

Recipe for Lualine #2

@dpetka2001

Description

@dpetka2001

Hi, really like this one. Here's a recipe for people who want to show the status of the timer in Lualine

local function get_timerly_status()
  local state = require("timerly.state")
  if state.progress == 0 then
    return ""
  end

  local total = math.max(0, state.total_secs + 1) -- Add 1 to sync with timer display
  local mins = math.floor(total / 60)
  local secs = total % 60

  return string.format("%s %02d:%02d", state.mode:gsub("^%l", string.upper), mins, secs)
end

table.insert(opts.sections.lualine_x, get_timerly_status)

Maybe you would like to use that in the README or not. It's up to you. I didn't see a Discussions or Wiki where I could post this, hence I'm posting as an issue even though it's not really one.

Thank you for your hard work 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions