Skip to content

Commit

Permalink
terminal/wezterm: detect colorscheme automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Feb 10, 2024
1 parent 32b0b3d commit 5dc12df
Showing 1 changed file with 27 additions and 66 deletions.
93 changes: 27 additions & 66 deletions homes/notashelf/programs/terminal/emulators/wezterm/config.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
{colors}:
with colors; ''
{colors, ...}:
/*
lua
*/
''
local wezterm = require("wezterm")
local act = wezterm.action
-- wezterm.gui is not available to the mux server, so take care to
-- do something reasonable when this config is evaluated by the mux
function get_appearance()
if wezterm.gui then
return wezterm.gui.get_appearance()
end
return 'Dark'
end
function scheme_for_appearance(appearance)
if appearance:find 'Dark' then
return 'Catppuccin Mocha'
else
return 'Catppuccin Latte'
end
end
return {
check_for_updates = false,
exit_behavior = "CloseOnCleanExit",
enable_scroll_bar = true,
enable_scroll_bar = false,
font_size = 14.0,
font = wezterm.font 'Iosevka Nerd Font Mono'
font = wezterm.font 'Iosevka Nerd Font',
color_scheme = scheme_for_appearance(get_appearance()),
audible_bell = "Disabled",
enable_tab_bar = true,
hide_tab_bar_if_only_one_tab = true,
default_cursor_style = "SteadyUnderline",
default_cursor_style = "SteadyBar",
window_background_opacity = 0.85,
window_padding = {
Expand All @@ -24,66 +46,5 @@ with colors; ''
top = 16,
bottom = 16,
},
colors = {
background = "#${base00}",
cursor_bg = "#${base05}",
cursor_fg = "#${base00}",
cursor_border = "#${base05}",
foreground = "#${base05}",
selection_bg = "#${base05}",
selection_fg = "#${base00}",
tab_bar = {
background = "#${base02}",
active_tab = {
bg_color = "#${base0D}",
fg_color = "#${base00}",
},
inactive_tab = {
bg_color = "#${base00}",
fg_color = "#${base08}",
},
inactive_tab_hover = {
bg_color = "#${base00}",
fg_color = "#${base0D}",
},
new_tab = {
bg_color = "#${base02}",
fg_color = "#${base08}",
},
new_tab_hover = {
bg_color = "#${base00}",
fg_color = "#${base0D}",
},
},
ansi = {
"#${base00}",
"#${base08}",
"#${base0B}",
"#${base0A}",
"#${base0D}",
"#${base0F}",
"#${base0C}",
"#${base05}"
},
brights = {
"#${base03}",
"#${base08}",
"#${base0B}",
"#${base0A}",
"#${base0D}",
"#${base0F}",
"#${base0C}",
"#${base07}"
},
},
}
''

0 comments on commit 5dc12df

Please sign in to comment.