local wezterm = require("wezterm") local mux = wezterm.mux local act = wezterm.action -- Set keymaps local keys = { { key = '{', mods = 'SHIFT|ALT', action = act.MoveTabRelative(-1) }, { key = '}', mods = 'SHIFT|ALT', action = act.MoveTabRelative(1) }, } for i = 1, 8 do -- CTRL+ALT + number to move to that position table.insert(keys, { key = tostring(i), mods = 'CTRL|ALT', action = wezterm.action.MoveTab(i - 1), }) end -- maximize on startup wezterm.on("gui-startup", function(cmd) local tab, pane, window = mux.spawn_window(cmd or {}) window:gui_window():maximize() end) local function get_battery_icon(state_of_charge, state) local battery_icons = { Charging = "", Unknown = "", Empty = "", Full = "", Discharging = { [1] = "", [2] = "", [3] = "", [4] = "", [5] = "", [6] = "", [7] = "", [8] = "", [9] = "", }, } local icon = battery_icons[state] if type(icon) ~= "table" then return icon else return icon[math.floor(state_of_charge * 10)] end end wezterm.on("update-right-status", function(window, _) -- "Wed Mar 3 08:14" local date = wezterm.strftime("%a %b %-d %H:%M ") local bat = "" for _, b in ipairs(wezterm.battery_info()) do bat = get_battery_icon(b.state_of_charge, b.state) .. " " .. string.format("%.0f%%", b.state_of_charge * 100) end window:set_right_status(wezterm.format({ { Text = bat .. " " .. date }, })) end) return { leader = { key = "a", mods = "CTRL" }, default_prog = { "wsl.exe", "-d", "Ubuntu-22.04", "--cd", "~" }, font = wezterm.font("VictorMono NFM", { weight = "DemiBold" }), font_size = 10.0, audible_bell = "Disabled", color_scheme = "Kanagawa (Gogh)", scrollback_lines = 10000, window_decorations = "RESIZE", tab_bar_at_bottom = true, use_fancy_tab_bar = false, tab_max_width = 64, keys = keys, force_reverse_video_cursor = true, window_background_opacity = 0.9, }