[feature] use primary monitor dpi instead of min
This commit is contained in:
parent
d52d581006
commit
986c021371
|
@ -4,19 +4,13 @@
|
||||||
|
|
||||||
|
|
||||||
xrandr | awk '
|
xrandr | awk '
|
||||||
BEGIN {
|
$2 == "connected" && $3 == "primary" {
|
||||||
MIN_DPI=99999999
|
if (match($0, / ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) (left|right)?/, m1) &&
|
||||||
}
|
|
||||||
$2 == "connected" {
|
|
||||||
if (match($0, / ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) /, 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[1]
|
DPI=m1[1]*25.4/m2[m1[5]?2:1]
|
||||||
if (DPI < MIN_DPI) MIN_DPI=DPI
|
printf "Xft.dpi: %i", DPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
END {
|
|
||||||
printf "Xft.dpi: %i", MIN_DPI+0.5
|
|
||||||
}
|
|
||||||
' | xrdb -merge
|
' | xrdb -merge
|
||||||
|
|
||||||
nitrogen --restore
|
nitrogen --restore
|
||||||
|
|
Loading…
Reference in New Issue
Block a user