feat: wezterm config

This commit is contained in:
WinterEkisha committed 2026-11-18 13:37:37 -08:00
1 parent 56e7ad6de9
commit 58ec82092c
4 files changed
+95 -13

No files matched your search

+40 -2
View File
@@ -19,6 +19,7 @@
enable = true; enable = true;
settings = { settings = {
filter = "classic"; # Options: classic, octagon, pro, machine filter = "classic"; # Options: classic, octagon, pro, machine
transparent_background = true;
}; };
}; };
#colorschemes.nightfox = { #colorschemes.nightfox = {
@@ -32,11 +33,16 @@
relativenumber = true; relativenumber = true;
}; };
# --- Sets tab spacing for file types --- autoGroups = {
WezTermUserVar = {
clear = true;
};
};
autoCmd = [ autoCmd = [
# --- Sets tab spacing for file types ---
{ {
event = [ "FileType" ]; event = [ "FileType" ];
pattern = [ "html" "css" "javascript" "typescript" "nix" ]; pattern = [ "html" "css" "javascript" "typescript" "nix" "lua" ];
callback = { callback = {
__raw = '' __raw = ''
function() function()
@@ -47,6 +53,38 @@
''; '';
}; };
} }
{
event = [ "UIEnter" "VimResume" ];
group = "WezTermUserVar";
callback = {
__raw = ''
function()
local b64 = vim.base64.encode('true')
local seq = string.format('\x1b]1337;SetUserVar=%s=%s\x07', 'IS_NVIM', b64)
if vim.env.TMUX then
seq = string.format('\x1bPtmux;\x1b%s\x1b\\', seq)
end
pcall(vim.fn.chansend, vim.v.stderr, seq)
end
'';
};
}
{
event = [ "VimLeavePre" "VimSuspend" ];
group = "WezTermUserVar";
callback = {
__raw = ''
function()
local b64 = vim.base64.encode('false')
local seq = string.format('\x1b]1337;SetUserVar=%s=%s\x07', 'IS_NVIM', b64)
if vim.env.TMUX then
seq = string.format('\x1bPtmux;\x1b%s\x1b\\', seq)
end
pcall(vim.fn.chansend, vim.v.stderr, seq)
end
'';
};
}
]; ];
plugins.cmp = { plugins.cmp = {
-9
View File
@@ -53,15 +53,6 @@
''; '';
}; };
programs.kitty = {
enable = true;
settings = {
"font_size" = 15;
"background_opacity" = 0.6;
"background_blur" = 1;
"include" = "colors.conf";
};
};
programs.starship = { programs.starship = {
enable = true; enable = true;
}; };
@@ -3,12 +3,65 @@ local config = wezterm.config_builder()
-- Launch fish directly instead of your system login shell -- Launch fish directly instead of your system login shell
config.default_prog = { 'fish', '-l' } config.default_prog = { 'fish', '-l' }
-- Appearance & Tab Bar -- Appearance & Tab Bar
config.window_background_opacity = 0.60 config.window_background_opacity = 0.60
config.wayland_window_background_blur = true config.wayland_window_background_blur = true
config.hide_tab_bar_if_only_one_tab = true config.hide_tab_bar_if_only_one_tab = true
config.font_size = 15.0 config.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
config.font_size = 14.0
config.colors = {
foreground = '#dddddd',
}
local bg_image_path = wezterm.config_dir .. '/texture.png'
local function sync_nvim_appearance(window, pane)
if not pane then
return
end
local user_vars = pane:get_user_vars()
local is_nvim = user_vars.IS_NVIM == 'true'
local overrides = window:get_config_overrides() or {}
-- Avoid redundant config reloads if state hasn't changed
local currently_active = overrides.window_background_image ~= nil
if is_nvim == currently_active then
return
end
if is_nvim then
overrides.colors = {
foreground = '#ffffff',
}
overrides.window_background_opacity = 1.0
overrides.window_background_image = bg_image_path
else
overrides.colors = nil
overrides.window_background_opacity = nil
overrides.window_background_image = nil
end
window:set_config_overrides(overrides)
end
wezterm.on('user-var-changed', function(window, pane, name, _value)
if name == 'IS_NVIM' then
sync_nvim_appearance(window, pane)
end
end)
-- Also sync when switching tabs or closing panes
wezterm.on('update-status', function(window, pane)
sync_nvim_appearance(window, pane)
end)
return config return config
@@ -3,7 +3,7 @@
pkgs, pkgs,
... ...
}:{ }:{
xdg.configFile."wezterm/wezterm.lua".source = ./weztermlua; xdg.configFile."wezterm/wezterm.lua".source = ./wezterm.lua;
programs.wezterm = { programs.wezterm = {
enable = true; enable = true;
package = pkgs.unstablePkgs.wezterm; package = pkgs.unstablePkgs.wezterm;