pommodoro-clock.nvim icon indicating copy to clipboard operation
pommodoro-clock.nvim copied to clipboard

Make the size configurable?

Open silentjay opened this issue 1 year ago • 2 comments

Firstly absolutely love the styling of this plugin, however I'd love to make it a bit smaller via options if possible? Or would this break the ASCII art?

silentjay avatar Apr 14 '23 09:04 silentjay

First: Love this - been looking for a good pommodoro timer for a while. Thanks for building this!

I have the same issue. Even better if there was an option to show the timer in lualine instead on top of buffer, so that it stays in there discreetly and out of the way.

monopoly-db avatar May 10 '23 19:05 monopoly-db

you should change the size of the ASCII art itself: in utils.lua file replace these numbers

local M = {}

local zero = [[
█▀▀█
█  █
█▄▄█
]]

local one = [[
 ▄█░
░░█░
░▄█▄
]]

local two = [[
░█▀█
 ░▄▀
░█▄▄
]]

local tree = [[
█▀▀█
░░▀▄
█▄▄█
]]

local four = [[
░█▀█
█▄▄█
░░░█
]]

local five = [[
 █▀▀
 ▀▀▄
░▄▄▀
]]

local six = [[
▄▀▀▄
█▄▄░
▀▄▄▀
]]

local seven = [[
▀▀▀█
░░█░
░▐▌░
]]

local eight = [[
███ 
█ █
█ █
███ 
]]

local nine = [[
▄▀▀▄
▀▄▄█
░▄▄▀
]]

local separator = [[
▄
░
▀
]]

local clock = [[
██
  
  
]]

local chars = {
  ["0"] = zero,
  ["1"] = one,
  ["2"] = two,
  ["3"] = tree,
  ["4"] = four,
  ["5"] = five,
  ["6"] = six,
  ["7"] = seven,
  ["8"] = eight,
  ["9"] = nine,
  [":"] = separator,
  ["c"] = clock,
}

M.split_string_by_line = function(text)
  local lines = {}
  for line in text:gmatch("([^\n]*)\n?") do
    table.insert(lines, line)
  end
  return lines
end

M.str_to_ascii = function(str)
  local lines = {
    {},
    {},
    {},
    {},
  }
  for _, s in ipairs(str) do
    local char = chars[s]
    local char_lines = M.split_string_by_line(char)
    for i, line in ipairs(char_lines) do
      table.insert(lines[i], line)
    end
  end

  return {
    table.concat(lines[1], " "),
    table.concat(lines[2], " "),
    table.concat(lines[3], " "),
  }
end

return M

shakori999 avatar Sep 02 '23 09:09 shakori999