From 83d6e3f7cfa84ac25f30ef69a5af1df423fbab6a Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Thu, 8 Feb 2024 09:15:22 +0100 Subject: [PATCH] wezterm config --- .wezterm.lua | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .wezterm.lua diff --git a/.wezterm.lua b/.wezterm.lua new file mode 100644 index 0000000..efd154a --- /dev/null +++ b/.wezterm.lua @@ -0,0 +1,57 @@ +-- Pull in the wezterm API +local wezterm = require 'wezterm' + +-- This will hold the configuration. +local config = wezterm.config_builder() + +function scheme_for_appearance(appearance) + if appearance:find 'Dark' then + return 'Catppuccin Mocha' + else + return 'Catppuccin Latte' + end +end + +local act = wezterm.action + +local config = wezterm.config_builder() +config.keys = { + { + key = 'E', + mods = 'CTRL|SHIFT', + action = act.PromptInputLine { + description = 'Enter new name for tab', + action = wezterm.action_callback(function(window, pane, line) + -- line will be `nil` if they hit escape without entering anything + -- An empty string if they just hit enter + -- Or the actual line of text they wrote + if line then + window:active_tab():set_title(line) + end + end), + }, + }, +} + +wezterm.on('window-config-reloaded', function(window, pane) + local overrides = window:get_config_overrides() or {} + local appearance = window:get_appearance() + local scheme = scheme_for_appearance(appearance) + if overrides.color_scheme ~= scheme then + overrides.color_scheme = scheme + window:set_config_overrides(overrides) + end +end) + +-- This is where you actually apply your config choices + +-- For example, changing the color scheme: +-- config.color_scheme = 'AdventureTime' +config.font = wezterm.font 'Victor Mono' +config.window_background_opacity = 0.9 +config.macos_window_background_blur = 10 +config.use_fancy_tab_bar = false +config.hide_tab_bar_if_only_one_tab = true +config.window_decorations = "RESIZE" +-- and finally, return the configuration to wezterm +return config