From 677de04ee2321dc223553cd2c8ad1d0a8eb3f1f6 Mon Sep 17 00:00:00 2001 From: Kitty Cat Date: Thu, 17 Oct 2024 00:38:51 -0400 Subject: [PATCH] add wezterm config --- wezterm/wezterm.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 wezterm/wezterm.lua diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua new file mode 100644 index 0000000..621b14d --- /dev/null +++ b/wezterm/wezterm.lua @@ -0,0 +1,44 @@ +-- Function to search PATH for a program +function program_exists(program) + local path_separator = package.config:sub(1,1) == "\\" and ";" or ":" + for path in string.gmatch(os.getenv("PATH"), "[^" .. path_separator .. "]+") do + local file_path = path .. "/" .. program + local file = io.open(file_path, "r") + if file then + file:close() + return true + end + end + return false +end + + +local wezterm = require 'wezterm' +local config = wezterm.config_builder() + +config.color_scheme = 'Windows NT (base16)' + +config.font = wezterm.font 'Iosevka' +config.font_size = 12.0 + +config.use_fancy_tab_bar = false +config.hide_tab_bar_if_only_one_tab = true + +config.window_padding = { left = 0, right = 0, top = 0, bottom = 0 } +config.initial_cols = 120 +config.initial_rows = 30 + +-- Select default shell if running on Windows +if (package.config:sub(1,1) == '\\') then + if program_exists('nu.exe') then + config.default_prog = { 'nu.exe' } + elseif program_exists('pwsh.exe') then + config.default_prog = { 'pwsh.exe' } + elseif program_exists('powershell.exe') then + config.default_prog = { 'powershell.exe' } + else + config.default_prog = { 'cmd.exe' } + end +end + +return config