From 8e39e4b051c590ecc5caa2ad623dbd5833677629 Mon Sep 17 00:00:00 2001 From: David Ibia Date: Mon, 29 Jul 2024 00:57:12 +0100 Subject: [PATCH] style(wezterm.lua): reformat config settings for better readability and consistency feat(wezterm.lua): add support for custom colorscheme by reading from a file or defaulting to 'Catppuccin Mocha' if file not found --- .config/wezterm/wezterm.lua | 68 +++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/.config/wezterm/wezterm.lua b/.config/wezterm/wezterm.lua index 2d98488..055d881 100644 --- a/.config/wezterm/wezterm.lua +++ b/.config/wezterm/wezterm.lua @@ -2,35 +2,45 @@ local wezterm = require("wezterm") local config = wezterm.config_builder() -config = { - automatically_reload_config = true, - enable_tab_bar = false, - window_close_confirmation = "NeverPrompt", - window_decorations = "RESIZE", - default_cursor_style = "BlinkingBlock", - cursor_blink_rate = 0, - color_scheme = "tokyonight", - font = wezterm.font("FiraCode Nerd Font", { weight = 450, stretch = "Normal", style = "Normal" }), - font_size = 12.5, - background = { - { - source = { - Color = "#1a1b26", - }, - width = "100%", - height = "100%", - opacity = 0.95, - - } - }, - window_padding = { - left = 3, - right = 3, - top = 20, - bottom = 0, - }, - - +config.automatically_reload_config = true +config.enable_tab_bar = false +config.scrollback_lines = 10000 +config.use_dead_keys = false +config.window_close_confirmation = "NeverPrompt" +config.window_decorations = "RESIZE" +config.default_cursor_style = "BlinkingBlock" +config.cursor_blink_rate = 0 +config.font = wezterm.font("FiraCode Nerd Font", { weight = 450, stretch = "Normal", style = "Normal" }) +config.font_size = 14 +config.window_background_opacity = .9 +-- background = { +-- { +-- source = { +-- Color = "#1a1b26", +-- }, +-- width = "100%", +-- height = "100%", +-- opacity = 0.90, +-- +-- } +-- }, +config.window_padding = { + left = 3, + right = 3, + top = 20, + bottom = 0, } + + + +-- Colorscheme +local file = io.open(wezterm.config_dir .. "/colorscheme", "r") +if file then + config.color_scheme = file:read("*a") + file:close() +else + config.color_scheme = 'Catppuccin Mocha' +end + return config