Fix DPI scaling (#287)

This commit is contained in:
Jeff M. Hubbard 2021-09-05 12:10:09 -05:00 committed by Sebastian Sellmeier
parent de7bcdc2b5
commit 806866de57
No known key found for this signature in database
GPG key ID: 51E2BE0CCC826F98

View file

@ -314,14 +314,8 @@ logical_px() {
# adjust scaling # adjust scaling
if [ -n "$dpi" ]; then if [ -n "$dpi" ]; then
local scale local scale
scale=$(echo "scale=2; $dpi / 96.0" | bc) scale=$(echo "scale=3; $dpi / 96.0" | bc)
echo "$scale * $pixels / 1" | bc
# check if scaling the value is worthy
if [ "$(echo "$scale > 1.25" | bc -l)" -eq 0 ]; then
echo "$pixels"
else
echo "$scale * $pixels / 1" | bc
fi
else else
# return the default value if no DPI is set # return the default value if no DPI is set
echo "$pixels" echo "$pixels"
@ -977,4 +971,4 @@ echof header "Betterlockscreen"
[[ $runlock ]] && lockselect "$lockstyle" && \ [[ $runlock ]] && lockselect "$lockstyle" && \
{ [[ $runsuspend ]] && systemctl suspend; } { [[ $runsuspend ]] && systemctl suspend; }
exit 0 exit 0