dotfiles/wezterm/config/appearance.lua

83 lines
2.3 KiB
Lua
Raw Normal View History

2023-03-22 11:20:01 +00:00
-- This module should set the appearance-related options.
local module = {}
local wezterm = require("wezterm")
local light_scheme, light_scheme_metadata =
wezterm.color.load_base16_scheme(os.getenv("HOME") .. "/library/dotfiles/base16/albino-bark-on-a-tree.yaml")
local dark_theme, dark_theme_metadata =
wezterm.color.load_base16_scheme(os.getenv("HOME") .. "/library/dotfiles/base16/bark-on-a-tree.yaml")
2023-03-22 11:20:01 +00:00
local function scheme_for_appearance()
local scheme = wezterm.gui.get_appearance()
if scheme == "Dark" then
return dark_theme_metadata.name
2023-03-22 11:20:01 +00:00
else
return light_scheme_metadata.name
2023-03-22 11:20:01 +00:00
end
end
function module.add_base16_scheme_to_config(path, config)
local scheme, metadata = wezterm.color.load_base16_scheme(path)
config.color_schemes[metadata.name] = scheme
return config
end
2023-03-22 11:20:01 +00:00
--- Apply the configuration with the given table.
-- @param config: the table containing Wezterm configuration.
function module.apply_to_config(config)
config.color_schemes = {}
2023-07-08 03:36:55 +00:00
config.font_size = 19
2023-07-02 09:18:03 +00:00
-- Thankfully, wezterm can detect fontconfig aliases.
2023-07-08 03:36:55 +00:00
config.font = wezterm.font_with_fallback {
"monospace",
"Noto Color Emoji",
2023-07-08 03:36:55 +00:00
}
-- Desaturate any inactive panes.
config.inactive_pane_hsb = {
saturation = 0.5,
brightness = 0.5,
}
-- Set with my color schemes.
config.color_schemes[dark_theme_metadata.name] = dark_theme
config.color_schemes[light_scheme_metadata.name] = light_scheme
2023-03-22 11:20:01 +00:00
config.color_scheme = scheme_for_appearance()
2023-07-25 10:25:22 +00:00
config.command_palette_fg_color = config.color_schemes[config.color_scheme].foreground
config.command_palette_bg_color = config.color_schemes[config.color_scheme].background
config.command_palette_font_size = config.font_size
2023-07-02 09:18:03 +00:00
-- Disable some annoying mouse thingies.
config.hide_mouse_cursor_when_typing = false
config.pane_focus_follows_mouse = true
-- Disable some more annoyances.
2023-07-08 03:36:55 +00:00
config.enable_tab_bar = true
config.enable_scroll_bar = false
config.tab_bar_at_bottom = true
config.window_decorations = "RESIZE"
-- Configuring the appearance of the tab bar.
config.window_frame = {
font = config.font,
font_size = config.font_size - 2,
}
-- Configuring the windows padding.
config.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
2023-07-02 09:18:03 +00:00
2023-03-22 11:20:01 +00:00
return config
end
return module