xrandr: don't poll hardware when it's not needed

This commit is contained in:
Vincent Bernat 2020-01-29 11:16:05 +01:00
parent 95dd95e4ce
commit 08fa9a63d0
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@
DISPLAY=${DISPLAY%.0}
# For information
xrandr \
xrandr --current \
| sed -n 's/^\([^ ]\)* connected.* \([0-9]*\)x.* \([0-9]*\)mm x .*/\1 \2 \3/p' \
| while read output pixels mm; do
dpi=$(($pixels * 25.4 / $mm))