From e3387ee785bd90d0ef274061ba67081716ae8f42 Mon Sep 17 00:00:00 2001 From: TrudeEH Date: Fri, 7 Jun 2024 00:19:44 +0100 Subject: [PATCH] Use .Xresources to scale fonts for HiDPI screens --- dotfiles/.Xresources | 1 + dotfiles/.xinitrc | 1 + programs/dmenu/config.def.h | 2 +- programs/dwm/config.def.h | 2 +- programs/st/config.def.h | 2 +- programs/tabbed/config.def.h | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 dotfiles/.Xresources diff --git a/dotfiles/.Xresources b/dotfiles/.Xresources new file mode 100644 index 00000000..72a44710 --- /dev/null +++ b/dotfiles/.Xresources @@ -0,0 +1 @@ +Xft.dpi: 192 diff --git a/dotfiles/.xinitrc b/dotfiles/.xinitrc index aac20553..cd83a0a7 100644 --- a/dotfiles/.xinitrc +++ b/dotfiles/.xinitrc @@ -1,4 +1,5 @@ slstatus & feh --bg-scale "/home/trude/dotfiles/bg2.png" & +xrdb ~/.Xresources exec dwm diff --git a/programs/dmenu/config.def.h b/programs/dmenu/config.def.h index 252c6beb..183d95cb 100644 --- a/programs/dmenu/config.def.h +++ b/programs/dmenu/config.def.h @@ -4,7 +4,7 @@ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ /* -fn option overrides fonts[0]; default X11 font or font set */ static const char *fonts[] = { - "JetBrainsMono NF:size=20" + "JetBrainsMono NF:size=10" }; static const char *prompt = NULL; /* -p option; prompt to the left of input field */ static const char *colors[SchemeLast][2] = { diff --git a/programs/dwm/config.def.h b/programs/dwm/config.def.h index f5252785..fa504847 100644 --- a/programs/dwm/config.def.h +++ b/programs/dwm/config.def.h @@ -13,7 +13,7 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display static const int showsystray = 1; /* 0 means no systray */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "JetBrainsMono NF:size=20" }; +static const char *fonts[] = { "JetBrainsMono NF:size=10" }; static const char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { "#ebdbb2", "#282828", "#1d2021" }, diff --git a/programs/st/config.def.h b/programs/st/config.def.h index 677758a9..6be920f5 100644 --- a/programs/st/config.def.h +++ b/programs/st/config.def.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "JetBrainsMono NF:pixelsize=24:antialias=true:autohint=true"; +static char *font = "JetBrainsMono NF:size=12:antialias=true:autohint=true"; static int borderpx = 2; /* diff --git a/programs/tabbed/config.def.h b/programs/tabbed/config.def.h index 51bb13db..2c141659 100644 --- a/programs/tabbed/config.def.h +++ b/programs/tabbed/config.def.h @@ -1,7 +1,7 @@ /* See LICENSE file for copyright and license details. */ /* appearance */ -static const char font[] = "monospace:size=9"; +static const char font[] = "JetBrainsMono NF:size=10"; static const char* normbgcolor = "#222222"; static const char* normfgcolor = "#cccccc"; static const char* selbgcolor = "#555555";