2024-05-06 02:50:13 +01:00
|
|
|
-- Pull in the wezterm API
|
|
|
|
local wezterm = require("wezterm")
|
|
|
|
|
|
|
|
-- This will hold the configuration.
|
|
|
|
local config = wezterm.config_builder()
|
|
|
|
|
2024-12-08 15:49:58 +00:00
|
|
|
function on_dark_mode(overrides)
|
|
|
|
overrides.colors = {
|
|
|
|
tab_bar = {
|
|
|
|
background = "#232136",
|
|
|
|
active_tab = {
|
|
|
|
bg_color = "#ea9a97",
|
|
|
|
fg_color = "#232136",
|
|
|
|
},
|
|
|
|
inactive_tab = {
|
|
|
|
bg_color = "#6e6a86",
|
|
|
|
fg_color = "#e0def4",
|
|
|
|
},
|
|
|
|
new_tab = {
|
|
|
|
bg_color = "#2a273f",
|
|
|
|
fg_color = "#e0def4",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
function on_light_mode(overrides)
|
|
|
|
overrides.colors = {
|
|
|
|
tab_bar = {
|
|
|
|
background = "#faf4ed",
|
|
|
|
active_tab = {
|
|
|
|
bg_color = "#d7827e",
|
|
|
|
fg_color = "#e0def4",
|
|
|
|
},
|
|
|
|
inactive_tab = {
|
|
|
|
bg_color = "#9893a5",
|
|
|
|
fg_color = "#f2e9e1",
|
|
|
|
},
|
|
|
|
new_tab = {
|
|
|
|
bg_color = "#fffaf3",
|
|
|
|
fg_color = "#575279",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
function scheme_for_appearance(appearance, overrides)
|
2024-05-06 02:50:13 +01:00
|
|
|
if appearance:find("Dark") then
|
2024-12-08 15:49:58 +00:00
|
|
|
on_dark_mode(overrides)
|
|
|
|
return "rose-pine-moon"
|
2024-05-06 02:50:13 +01:00
|
|
|
else
|
2024-12-08 15:49:58 +00:00
|
|
|
on_light_mode(overrides)
|
|
|
|
return "rose-pine-dawn"
|
2024-05-06 02:50:13 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
wezterm.on("window-config-reloaded", function(window, pane)
|
|
|
|
local overrides = window:get_config_overrides() or {}
|
|
|
|
local appearance = window:get_appearance()
|
2024-12-08 15:49:58 +00:00
|
|
|
local scheme = scheme_for_appearance(appearance, overrides)
|
2024-05-06 02:50:13 +01:00
|
|
|
if overrides.color_scheme ~= scheme then
|
|
|
|
overrides.color_scheme = scheme
|
|
|
|
window:set_config_overrides(overrides)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
2024-12-08 15:49:58 +00:00
|
|
|
config.font = wezterm.font("Fira Code")
|
2024-10-28 19:41:48 +00:00
|
|
|
config.font_size = 14
|
2024-05-06 02:50:13 +01:00
|
|
|
|
2024-12-08 15:49:58 +00:00
|
|
|
config.enable_tab_bar = false
|
2024-05-06 17:06:42 +01:00
|
|
|
config.use_fancy_tab_bar = false
|
|
|
|
config.tab_bar_at_bottom = true
|
|
|
|
|
|
|
|
config.window_padding = {
|
|
|
|
left = "1cell",
|
|
|
|
right = "1cell",
|
|
|
|
top = 0,
|
|
|
|
bottom = 0,
|
|
|
|
}
|
2024-12-08 15:49:58 +00:00
|
|
|
config.window_decorations = "RESIZE"
|
2024-05-06 17:06:42 +01:00
|
|
|
|
2024-05-06 02:50:13 +01:00
|
|
|
return config
|