mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-06 00:04:20 +02:00
xsettingsd: compute best DPI value for each screen
This commit is contained in:
parent
1411929ead
commit
1902a4f0b5
1 changed files with 2 additions and 1 deletions
|
@ -7,7 +7,8 @@ xrandr --current \
|
||||||
| sed -n 's/^\([^ ]\{1,\}\)* connected.* \([0-9]\{1,\}\)x.* \([0-9]\{1,\}\)mm x .*/\1 \2 \3/p' \
|
| sed -n 's/^\([^ ]\{1,\}\)* connected.* \([0-9]\{1,\}\)x.* \([0-9]\{1,\}\)mm x .*/\1 \2 \3/p' \
|
||||||
| while read output pixels mm; do
|
| while read output pixels mm; do
|
||||||
dpi=$(($pixels * 254 / 10 / $mm))
|
dpi=$(($pixels * 254 / 10 / $mm))
|
||||||
echo "$output: $dpi DPI"
|
rounded=$(((dpi + 24) / 48 * 48))
|
||||||
|
echo "$output: ${dpi}dpi (rounded to ${rounded}dpi)"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Don't try to guess DPI. For a laptop, we don't want the same DPI as
|
# Don't try to guess DPI. For a laptop, we don't want the same DPI as
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue