fix(wezterm): improve handling of linux settings

This commit is contained in:
winston 2022-08-04 05:31:50 +02:00
parent dde9c3f828
commit 070c85d9e6
Signed by: winston
GPG key ID: 3786770EDBC2B481

View file

@ -1,7 +1,46 @@
-- vim:foldmethod=marker:foldlevel=1
local wezterm = require("wezterm")
local function get_os()
local target = wezterm.target_triple
if string.find(target, "linux") then
return "linux"
elseif string.find(target, "darwin") then
return "macos"
else
-- who cares
return "OH GOD PLEASE NO"
end
end
local opt
if get_os() == "linux" then
opt = {
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0
},
font_size = 14,
sync = false
}
elseif get_os() == "macos" then
opt = {
window_padding = {
left = 2,
right = 2,
top = 2,
bottom = 2
},
font_size = 18,
sync = true
}
end
local catppuccin = require("colors/catppuccin/catppuccin").setup({
sync = opt.sync,
flavour = "mocha",
sync_flavours = {
light = "latte",
dark = "mocha",
@ -143,35 +182,6 @@ wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_wid
end)
-- }}}
local function get_os()
local target = wezterm.target_triple
if string.find(target, "linux") then
return "linux"
elseif string.find(target, "darwin") then
return "macos"
else
-- who cares
return "OH GOD PLEASE NO"
end
end
local window_padding = {}
if get_os() == "linux" then
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
elseif get_os() == "macos" then
window_padding = {
left = 2,
right = 2,
top = 2,
bottom = 2,
}
end
local act = wezterm.action
return {
@ -222,7 +232,7 @@ return {
{ key = "v", mods = "LEADER", action = "ActivateCopyMode" },
},
-- font
font_size = 18,
font_size = opt.font_size,
font = fonts.victor,
use_fancy_tab_bar = false,
tab_bar_at_bottom = true,
@ -230,7 +240,7 @@ return {
tab_max_width = 32,
-- window
window_decorations = "RESIZE",
window_padding = window_padding,
window_padding = opt.window_padding,
-- theme
colors = catppuccin,
-- nightly only