From 89b177ffba80241c3bb62a52d7322262da4b94fe Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Sun, 29 Oct 2023 16:09:32 +0100 Subject: [PATCH] In i3, we can get DPI from Xresources --- .Xresources.laptop | 3 +++ .config/i3/config.d/laptop | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.Xresources.laptop b/.Xresources.laptop index 4f58b68..47323a4 100644 --- a/.Xresources.laptop +++ b/.Xresources.laptop @@ -1,3 +1,6 @@ +!*dpi is used by i3WM +!See https://i3wm.org/docs/userguide.html#xresources +*dpi: 120 Xft.dpi: 120 Xft.autohint: 0 Xft.lcdfilter: lcddefault diff --git a/.config/i3/config.d/laptop b/.config/i3/config.d/laptop index c81756d..00efa02 100644 --- a/.config/i3/config.d/laptop +++ b/.config/i3/config.d/laptop @@ -13,8 +13,10 @@ bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +10% bindsym XF86KbdBrightnessDown exec --no-startup-id brightnessctl -d asus::kbd_backlight set +10% bindsym XF86KbdBrightnessUp exec --no-startup-id brightnessctl -d asus::kbd_backlight set 10%- +# Get chosen DPI from Xresources, default 120 +set_from_resource $dpi i3wm.dpi 120 # Only dunst seems to care about this setting -exec xrandr --dpi 120 +exec xrandr --dpi $dpi ################################## # PROGRAMS STARTED AUTOMATICALLY