diff --git a/apps/wezterm/wezterm.lua b/apps/wezterm/wezterm.lua index dcedb48d0d9075a93fa27657c98c5e7bda9f9926..0ec2d06669b1e55aabc4691f8ba8ded2f3697ae5 100644 --- a/apps/wezterm/wezterm.lua +++ b/apps/wezterm/wezterm.lua @@ -1,5 +1,14 @@ local wezterm = require "wezterm" +-- Choose theme based on system +function theme_for_appearance(appearance) + if appearance:find "Dark" then + return "Catppuccin Mocha" + else + return "Catppuccin Latte" + end +end + -- Update right status with "mode" wezterm.on('update-right-status', function(window, pane) local name = window:active_key_table() @@ -23,113 +32,98 @@ window:set_config_overrides({ window_background_opacity = opacity }) end) -- config -local cfg = wezterm.config_builder() -cfg.default_prog = { "nu", "--config", "~/.config/nushell/config.nu", "--env-config", "~/.config/nushell/env.nu" } -cfg.window_close_confirmation = 'NeverPrompt' -cfg.window_background_opacity = opacity - + end if name then - + end name = " " .. string.upper(string.sub(name, 1, 1)) .. " " - + end end - + end window:set_right_status(name or '') --- Update right status with "mode" + window:set_right_status(name or '') --- Update right status with "mode" + window:set_right_status(name or '') local wezterm = require "wezterm" --- Update right status with "mode" + window:set_right_status(name or '') --- Update right status with "mode" + window:set_right_status(name or '') -- Update right status with "mode" --- Update right status with "mode" + window:set_right_status(name or '') wezterm.on('update-right-status', function(window, pane) --- Update right status with "mode" + window:set_right_status(name or '') local name = window:active_key_table() --- Update right status with "mode" if name then --- Update right status with "mode" name = " " .. string.upper(string.sub(name, 1, 1)) .. " " - { key = "o", mods = "SHIFT|CTRL|ALT", action = wezterm.action.EmitEvent("toggle-opacity") }, --- Update right status with "mode" window:set_right_status(name or '') - { key = "RightArrow", mods = "SHIFT|CTRL", action = wezterm.action.ActivateTabRelative(1) }, - { key = "1", mods = "LEADER", action = wezterm.action.ActivateTab(0) }, - { key = "2", mods = "LEADER", action = wezterm.action.ActivateTab(1) }, - { key = "3", mods = "LEADER", action = wezterm.action.ActivateTab(2) }, - { key = "4", mods = "LEADER", action = wezterm.action.ActivateTab(3) }, - { key = "5", mods = "LEADER", action = wezterm.action.ActivateTab(4) }, -wezterm.on('update-right-status', function(window, pane) if name then -wezterm.on('update-right-status', function(window, pane) + window:set_right_status(name or '') name = " " .. string.upper(string.sub(name, 1, 1)) .. " " -wezterm.on('update-right-status', function(window, pane) + window:set_right_status(name or '') end -wezterm.on('update-right-status', function(window, pane) + window:set_right_status(name or '') window:set_right_status(name or '') - local name = window:active_key_table() +end) --- Update right status with "mode" +end) local wezterm = require "wezterm" - local name = window:active_key_table() + local wezterm = require "wezterm" + - local name = window:active_key_table() - local name = window:active_key_table() +end) -- Update right status with "mode" - local name = window:active_key_table() +end) wezterm.on('update-right-status', function(window, pane) - local name = window:active_key_table() +end) local name = window:active_key_table() - local name = window:active_key_table() +end) if name then - local name = window:active_key_table() +end) name = " " .. string.upper(string.sub(name, 1, 1)) .. " " - local name = window:active_key_table() +end) end - local name = window:active_key_table() +end) window:set_right_status(name or '') - if name then +-- Toggle opacity - if name then +-- Toggle opacity local wezterm = require "wezterm" - if name then +-- Toggle opacity if name then + name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +-- Toggle opacity -- Update right status with "mode" - if name then +-- Toggle opacity wezterm.on('update-right-status', function(window, pane) - if name then +-- Toggle opacity local name = window:active_key_table() - if name then +-- Toggle opacity if name then - if name then +-- Toggle opacity name = " " .. string.upper(string.sub(name, 1, 1)) .. " " --- Update right status with "mode" local wezterm = require "wezterm" - - if name then +local wezterm = require "wezterm" end - if name then +-- Toggle opacity window:set_right_status(name or '') - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 local wezterm = require "wezterm" - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 -- Update right status with "mode" - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 wezterm.on('update-right-status', function(window, pane) - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 local name = window:active_key_table() - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 if name then - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 name = " " .. string.upper(string.sub(name, 1, 1)) .. " " - name = " " .. string.upper(string.sub(name, 1, 1)) .. " " +local opacity = 0.8 end - } + }, + if name then name = " " .. string.upper(string.sub(name, 1, 1)) .. " " - local name = window:active_key_table() - +} -return cfg +