fix: fontsize too small for low dpi screen

This commit is contained in:
Klesh Wong 2021-09-28 21:46:20 +08:00
parent 4293bee82c
commit 2d05671269

View File

@ -7,10 +7,15 @@ xrandr | awk '
$2 == "connected" && $3 == "primary" { $2 == "connected" && $3 == "primary" {
if (match($0, / ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) (left|right)?/, m1) && 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)) { 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 printf "Xft.dpi: %i", DPI
} }
} }
' | xrdb -merge ' | xrdb -merge
systemctl --user restart dunst
nitrogen --restore nitrogen --restore