mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-19 18:34:31 +02:00
xsettingsd: don't use a subshell when computing DPI
This is to be able to use `dpi` variable. Also, for some reason, the journal doesn't keep the output of short-lived processes.
This commit is contained in:
parent
139af6fed5
commit
498606b38e
1 changed files with 6 additions and 3 deletions
|
@ -3,9 +3,12 @@
|
|||
DISPLAY=${DISPLAY%.0}
|
||||
|
||||
# For information
|
||||
xrandr --current \
|
||||
| sed -n 's/^\([^ ]\{1,\}\)* connected.* \([0-9]\{1,\}\)x.* \([0-9]\{1,\}\)mm x .*/\1 \2 \3/p' \
|
||||
| while read output pixels mm; do
|
||||
for info in $(xrandr --current \
|
||||
| sed -n 's/^\([^ ]\{1,\}\)* connected.* \([0-9]\{1,\}\)x.* \([0-9]\{1,\}\)mm x .*/\1,\2,\3/p'); do
|
||||
output=${info%%,*}
|
||||
pixels=${info#*,}
|
||||
pixels=${pixels%%,*}
|
||||
mm=${info##*,}
|
||||
dpi=$(($pixels * 254 / 10 / $mm))
|
||||
# For laptop screens, we need to apply a correction factor
|
||||
case $output in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue