From df96ee6bc57ee6cb955a31607c108c43a8adb930 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Mon, 17 Jun 2024 20:15:26 +0200 Subject: [PATCH] wezterm: set exact font size based on dpi --- .config/wezterm/wezterm.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/wezterm/wezterm.lua b/.config/wezterm/wezterm.lua index 8be9660..582baf4 100644 --- a/.config/wezterm/wezterm.lua +++ b/.config/wezterm/wezterm.lua @@ -154,8 +154,18 @@ config.font_rules = { }, } -config.font_size = 15 --- config.font_size = 18 +wezterm.on('window-config-reloaded', function(window, pane) + local overrides = window:get_config_overrides() or {} + local dpi = wezterm.gui.screens().active.effective_dpi + + if dpi > 96 then + overrides.font_size = 15 + else + overrides.font_size = 18 + end + window:set_config_overrides(overrides) +end) + config.warn_about_missing_glyphs = false config.bold_brightens_ansi_colors = false config.unicode_version = 14