fix scaling when Xft.dpi are set (#114)

This commit is contained in:
Yanze Li 2019-09-02 14:52:00 -05:00 committed by Philipp Hemmelmayr
parent 69ae265a40
commit 6c66db535f

View file

@ -158,7 +158,10 @@ lockselect() {
logical_px() {
# get dpi value from xrdb
local DPI
DPI=""$(xdpyinfo | sed -En "s/\s*resolution:\s*([0-9]*)x([0-9]*)\s.*/\\$2/p" | head -n1)
DPI=$(cat ~/.Xresource | grep -oP 'Xft.dpi:\s*\K\d+' | bc)
if [ -z "$DPI" ]; then
DPI=$(xdpyinfo | sed -En "s/\s*resolution:\s*([0-9]*)x([0-9]*)\s.*/\\$2/p" | head -n1)
fi
# return the default value if no DPI is set
if [ -z "$DPI" ]; then