From 2d05671269082de92d609ea94c1808688838b0df Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 28 Sep 2021 21:46:20 +0800 Subject: [PATCH] fix: fontsize too small for low dpi screen --- gui/autorandr/postswitch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gui/autorandr/postswitch b/gui/autorandr/postswitch index 496bb48..25e84bd 100755 --- a/gui/autorandr/postswitch +++ b/gui/autorandr/postswitch @@ -7,10 +7,15 @@ xrandr | awk ' $2 == "connected" && $3 == "primary" { if (match($0, / ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) (left|right)?/, m1) && match($0, / ([0-9]+)mm x ([0-9]+)mm$/, m2)) { - DPI=m1[1]*25.4/m2[m1[5]?2:1]*0.8 + DPI=m1[1]*25.4/m2[m1[5]?2:1] + if (DPI > 140) { + DPI=DPI*0.8 + } printf "Xft.dpi: %i", DPI } } ' | xrdb -merge +systemctl --user restart dunst + nitrogen --restore