2024-08-29 11:01:23 +02:00
|
|
|
local wezterm = require 'wezterm'
|
|
|
|
|
2024-01-14 18:35:00 +01:00
|
|
|
local config = {}
|
|
|
|
|
2024-02-10 14:52:08 +01:00
|
|
|
function getHostname()
|
|
|
|
local handle = io.popen("hostname -s")
|
|
|
|
local result = handle:read("*a")
|
|
|
|
handle:close()
|
|
|
|
return string.gsub(result, "\n$", "")
|
|
|
|
end
|
|
|
|
|
2024-06-03 17:55:51 +02:00
|
|
|
local HOSTNAME = getHostname()
|
|
|
|
|
2024-11-22 21:19:20 +01:00
|
|
|
config.color_scheme = "Apathy (base16)"
|
2024-07-02 17:17:32 +02:00
|
|
|
-- config.font = wezterm.font 'Hack Nerd Font Mono'
|
2024-11-22 17:37:00 +01:00
|
|
|
config.font = wezterm.font 'Hasklug Nerd Font Mono'
|
2024-07-02 17:17:32 +02:00
|
|
|
if getHostname() == "lilith" or getHostname() == "alastor" then
|
2024-02-10 14:52:08 +01:00
|
|
|
config.font_size = 15
|
|
|
|
else
|
|
|
|
config.font_size = 11
|
|
|
|
end
|
2024-07-03 11:46:08 +02:00
|
|
|
if os.getenv("DESKTOP_SESSION") == "plasma" or os.getenv("DESKTOP_SESSION") == "plasmax11" then
|
2024-06-03 17:55:51 +02:00
|
|
|
config.window_background_opacity = 1
|
2024-11-22 21:19:20 +01:00
|
|
|
elseif os.getenv("XDG_CURRENT_DESKTOP") == "sway" or os.getenv("XDG_CURRENT_DESKTOP") == "Hyprland" then
|
|
|
|
config.window_background_opacity = 1
|
2024-07-18 19:17:30 +02:00
|
|
|
else
|
2024-10-26 16:28:35 +02:00
|
|
|
config.window_background_opacity = .8
|
2024-06-03 17:55:51 +02:00
|
|
|
end
|
2024-10-26 16:28:35 +02:00
|
|
|
config.macos_window_background_blur = 10
|
2024-01-14 18:35:00 +01:00
|
|
|
config.keys = {
|
|
|
|
{
|
|
|
|
key = 't',
|
|
|
|
mods = 'CTRL',
|
|
|
|
action = wezterm.action.SpawnTab 'DefaultDomain',
|
2024-02-11 02:01:29 +01:00
|
|
|
},
|
2024-03-19 22:08:38 +01:00
|
|
|
{
|
|
|
|
key = 's',
|
|
|
|
mods = 'CTRL | SHIFT',
|
|
|
|
action = wezterm.action.PaneSelect
|
|
|
|
},
|
2024-03-22 18:26:55 +01:00
|
|
|
{
|
|
|
|
key = "LeftArrow",
|
|
|
|
mods = 'CTRL | ALT | SHIFT',
|
|
|
|
action = wezterm.action.AdjustPaneSize {
|
|
|
|
'Left',
|
|
|
|
5
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key = "RightArrow",
|
|
|
|
mods = 'CTRL | ALT | SHIFT',
|
|
|
|
action = wezterm.action.AdjustPaneSize {
|
|
|
|
'Right',
|
|
|
|
5
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key = "UpArrow",
|
|
|
|
mods = 'CTRL | ALT | SHIFT',
|
|
|
|
action = wezterm.action.AdjustPaneSize {
|
|
|
|
'Up',
|
|
|
|
5
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key = "DownArrow",
|
|
|
|
mods = 'CTRL | ALT | SHIFT',
|
|
|
|
action = wezterm.action.AdjustPaneSize {
|
|
|
|
'Down',
|
|
|
|
5
|
|
|
|
},
|
|
|
|
},
|
2024-02-11 02:01:29 +01:00
|
|
|
{
|
2024-10-23 21:04:35 +02:00
|
|
|
key = "h",
|
2024-02-11 02:01:29 +01:00
|
|
|
mods = 'CTRL | SHIFT',
|
|
|
|
action = wezterm.action.SplitPane {
|
|
|
|
direction = 'Left',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-10-23 21:04:35 +02:00
|
|
|
key = "l",
|
2024-02-11 02:01:29 +01:00
|
|
|
mods = 'CTRL | SHIFT',
|
|
|
|
action = wezterm.action.SplitPane {
|
|
|
|
direction = 'Right',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-10-23 21:04:35 +02:00
|
|
|
key = "k",
|
2024-02-11 02:01:29 +01:00
|
|
|
mods = 'CTRL | SHIFT',
|
|
|
|
action = wezterm.action.SplitPane {
|
|
|
|
direction = 'Up',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-10-23 21:04:35 +02:00
|
|
|
key = "j",
|
2024-02-11 02:01:29 +01:00
|
|
|
mods = 'CTRL | SHIFT',
|
|
|
|
action = wezterm.action.SplitPane {
|
|
|
|
direction = 'Down',
|
|
|
|
},
|
|
|
|
},
|
2024-01-14 18:35:00 +01:00
|
|
|
}
|
2024-02-11 02:01:29 +01:00
|
|
|
|
2024-01-14 18:35:00 +01:00
|
|
|
for i = 1, 8 do
|
2024-02-10 14:52:08 +01:00
|
|
|
-- CTRL+ALT + number to activate that tab
|
|
|
|
table.insert(config.keys, {
|
|
|
|
key = tostring(i),
|
|
|
|
mods = 'CTRL',
|
|
|
|
action = wezterm.action.ActivateTab(i - 1),
|
|
|
|
})
|
2024-01-14 18:35:00 +01:00
|
|
|
end
|
|
|
|
|
2024-03-19 22:08:38 +01:00
|
|
|
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
|
2024-10-26 16:41:19 +02:00
|
|
|
-- bat = '|🔋 ' .. string.format('%.0f%%', b.state_of_charge * 100) .. ' | '
|
|
|
|
bat = '| BAT ' .. string.format('%.0f%%', b.state_of_charge * 100) .. ' | '
|
2024-03-19 22:08:38 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
window:set_right_status(wezterm.format {
|
2024-11-22 17:37:00 +01:00
|
|
|
{ Text = bat .. date .. '🏴 🏳️⚧️' },
|
2024-03-19 22:08:38 +01:00
|
|
|
})
|
|
|
|
end)
|
|
|
|
wezterm.on('update-status', function(window, pane)
|
|
|
|
window:set_left_status(wezterm.format {
|
|
|
|
{ Text = '| λ |' },
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
|
2024-11-22 21:19:20 +01:00
|
|
|
config.front_end = 'OpenGL'
|
2024-07-19 16:11:33 +02:00
|
|
|
for _, gpu in ipairs(wezterm.gui.enumerate_gpus()) do
|
2024-08-29 11:01:23 +02:00
|
|
|
if gpu.backend == 'Vulkan' and gpu.device_type == 'IntegratedGpu' or gpu.device_type == "DiscreteGpu" then
|
2024-07-19 16:11:33 +02:00
|
|
|
config.webgpu_preferred_adapter = gpu
|
|
|
|
config.front_end = 'WebGpu'
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-11-22 21:19:20 +01:00
|
|
|
if HOSTNAME == 'asmodeus' then
|
|
|
|
config.enable_wayland = false
|
|
|
|
else
|
|
|
|
config.enable_wayland = false
|
|
|
|
end
|
|
|
|
|
2024-03-19 22:12:20 +01:00
|
|
|
config.hide_tab_bar_if_only_one_tab = false
|
2024-02-22 17:54:50 +01:00
|
|
|
config.use_fancy_tab_bar = false
|
2024-05-03 10:08:16 +02:00
|
|
|
config.text_background_opacity = 0.3
|
2024-02-10 14:52:08 +01:00
|
|
|
config.enable_scroll_bar = false
|
2024-01-14 18:35:00 +01:00
|
|
|
config.enable_tab_bar = true
|
2024-01-29 15:41:12 +01:00
|
|
|
config.tab_bar_at_bottom = true
|
2024-02-11 02:01:29 +01:00
|
|
|
config.hide_mouse_cursor_when_typing = false
|
2024-01-14 18:35:00 +01:00
|
|
|
config.warn_about_missing_glyphs = false
|
|
|
|
return config
|