nixos-config/home/config-files/wezterm.lua

97 lines
2 KiB
Lua
Raw Normal View History

local config = {}
function getHostname()
local handle = io.popen("hostname -s")
local result = handle:read("*a")
handle:close()
return string.gsub(result, "\n$", "")
end
2024-01-26 19:31:00 +01:00
config.color_scheme = "Catppuccin Mocha"
config.font = wezterm.font 'Hack Nerd Font Mono'
if getHostname() == "lilith" then
config.font_size = 15
else
config.font_size = 11
end
2024-02-12 20:08:44 +01:00
config.window_background_opacity = .85
config.keys = {
{
key = 't',
mods = 'CTRL',
action = wezterm.action.SpawnTab 'DefaultDomain',
},
{
key = 's',
mods = 'CTRL | SHIFT',
action = wezterm.action.PaneSelect
},
{
key = "LeftArrow",
mods = 'CTRL | SHIFT',
action = wezterm.action.SplitPane {
direction = 'Left',
},
},
{
key = "RightArrow",
mods = 'CTRL | SHIFT',
action = wezterm.action.SplitPane {
direction = 'Right',
},
},
{
key = "UpArrow",
mods = 'CTRL | SHIFT',
action = wezterm.action.SplitPane {
direction = 'Up',
},
},
{
key = "DownArrow",
mods = 'CTRL | SHIFT',
action = wezterm.action.SplitPane {
direction = 'Down',
},
},
}
for i = 1, 8 do
-- CTRL+ALT + number to activate that tab
table.insert(config.keys, {
key = tostring(i),
mods = 'CTRL',
action = wezterm.action.ActivateTab(i - 1),
})
end
wezterm.on('update-status', function(window, pane)
local date = wezterm.strftime '%a %b %-d %H:%M:%S |'
local bat = ''
for _, b in ipairs(wezterm.battery_info()) do
bat = '|🔋 ' .. string.format('%.0f%%', b.state_of_charge * 100) .. ' | '
end
window:set_right_status(wezterm.format {
{ Text = bat .. date },
})
end)
wezterm.on('update-status', function(window, pane)
window:set_left_status(wezterm.format {
{ Text = '| λ |' },
})
end)
2024-02-12 20:08:44 +01:00
config.hide_tab_bar_if_only_one_tab = true
config.use_fancy_tab_bar = false
config.text_background_opacity = .4
config.enable_scroll_bar = false
config.enable_tab_bar = true
config.tab_bar_at_bottom = true
config.hide_mouse_cursor_when_typing = false
config.enable_wayland = true
config.front_end = "OpenGL"
config.warn_about_missing_glyphs = false
return config