abzcoding / wezterm

my wezterm configuration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time based theming

Uzaaft opened this issue · comments

Inspired by your lvim config, if you'd like to have the same logic in WezTerm xD

local function get_theme()
  local _time = os.date "*t"
  if _time.hour >= 1 and _time.hour < 9 then
    return "Rosé Pine (base16)"
  elseif _time.hour >= 9 and _time.hour < 12 then
    return "tokyonight"
  elseif _time.hour >= 11 and _time.hour < 21 then
    return "Catppuccin Mocha"
  elseif _time.hour >= 21 and _time.hour < 24 or _time.hour >= 0 and _time.hour < 1 then
    return "kanagawabones"
  end
end  

@Uzaaft thank you very much

btw, do you still use wezterm or do you use kitty?

btw, do you still use wezterm or do you use kitty?

I do still use wezterm, but I'm busy with life atm so I haven't done much with my terminal 😢

That makes me glad(the wezterm part) xD
And busy is good xD I'm pretty much the same nowadays

FWIW, the latest wezterm release (made today!) has some more functions to help with this sort of thing; you can reason about sunrise and sunset, and the amount of time between:
https://wezfurlong.org/wezterm/config/lua/wezterm.time/Time/sun_times.html
you can arrange to reload the config when the time changes enough that you want to change your colors:
https://wezfurlong.org/wezterm/config/lua/wezterm.time/call_after.html

you can also use the various color functions in https://wezfurlong.org/wezterm/config/lua/wezterm.color/index.html to interpolate between the color schemes if you're feeling sufficiently motivated.

FWIW, the latest wezterm release (made today!) has some more functions to help with this sort of thing; you can reason about sunrise and sunset, and the amount of time between: https://wezfurlong.org/wezterm/config/lua/wezterm.time/Time/sun_times.html you can arrange to reload the config when the time changes enough that you want to change your colors: https://wezfurlong.org/wezterm/config/lua/wezterm.time/call_after.html

you can also use the various color functions in https://wezfurlong.org/wezterm/config/lua/wezterm.color/index.html to interpolate between the color schemes if you're feeling sufficiently motivated.

thanks mate <3