feat(wezterm): use new colorscheme sync
This commit is contained in:
parent
1b590af1a3
commit
b22f5b9569
1 changed files with 38 additions and 37 deletions
|
@ -1,40 +1,6 @@
|
||||||
-- vim:foldmethod=marker:foldlevel=1
|
-- vim:foldmethod=marker:foldlevel=1
|
||||||
local wezterm = require("wezterm")
|
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"
|
|
||||||
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
|
|
||||||
|
|
||||||
-- fonts I like, with the settings I prefer {{{
|
-- fonts I like, with the settings I prefer {{{
|
||||||
-- kept seperately from the rest of the config so that I can easily change them
|
-- kept seperately from the rest of the config so that I can easily change them
|
||||||
local fonts = {
|
local fonts = {
|
||||||
|
@ -125,8 +91,43 @@ wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_wid
|
||||||
end)
|
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"
|
||||||
|
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
|
local act = wezterm.action
|
||||||
|
|
||||||
|
local function scheme_for_appearance(appearance)
|
||||||
|
if appearance:find 'Dark' then
|
||||||
|
return 'Catppuccin Mocha'
|
||||||
|
else
|
||||||
|
return 'Catppuccin Latte'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
---- keyboard shortcuts
|
---- keyboard shortcuts
|
||||||
disable_default_key_bindings = false,
|
disable_default_key_bindings = false,
|
||||||
|
@ -175,7 +176,7 @@ return {
|
||||||
{ key = "v", mods = "LEADER", action = "ActivateCopyMode" },
|
{ key = "v", mods = "LEADER", action = "ActivateCopyMode" },
|
||||||
},
|
},
|
||||||
-- font
|
-- font
|
||||||
font_size = opt.font_size,
|
font_size = 18,
|
||||||
font = fonts.victor,
|
font = fonts.victor,
|
||||||
use_fancy_tab_bar = false,
|
use_fancy_tab_bar = false,
|
||||||
tab_bar_at_bottom = true,
|
tab_bar_at_bottom = true,
|
||||||
|
@ -183,9 +184,9 @@ return {
|
||||||
tab_max_width = 32,
|
tab_max_width = 32,
|
||||||
-- window
|
-- window
|
||||||
window_decorations = "RESIZE",
|
window_decorations = "RESIZE",
|
||||||
window_padding = opt.window_padding,
|
window_padding = window_padding,
|
||||||
-- theme
|
-- theme
|
||||||
color_scheme = "Catppuccin Mocha",
|
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
|
||||||
-- nightly only
|
-- nightly only
|
||||||
clean_exit_codes = { 130 },
|
clean_exit_codes = { 130 },
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue