mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-15 12:44:21 +02:00
xsettings: just hard-code appropriate DPI settings
This commit is contained in:
parent
06e6c28ac7
commit
b0d555ff98
1 changed files with 6 additions and 12 deletions
|
@ -1,17 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Compute DPI. We extract the value from xrandr output. The screen
|
# Don't try to guess DPI. For a laptop, we don't want the same DPI as
|
||||||
# size is correctly reported (while the X server is lying to respect
|
# for an external screen. Just hardcode stuff...
|
||||||
# the provided DPI). We round to the nearest quarter of 96 DPI (96,
|
case $(hostname),$(xrandr --current | sed -n 's/\([^ ]*\) connected primary.*/\1/p') in
|
||||||
# 120, 144, 168, 192...).
|
zoro,eDP1) dpi=144 ;;
|
||||||
eval $(xrandr --current | sed -n 's/.* connected primary \([0-9]*\)x.* \([0-9]*\)mm x .*/wd=\1\nwm=\2/p')
|
*) dpi=96 ;;
|
||||||
if [ -n "$wd" -a -n "$wm" ]; then
|
esac
|
||||||
dpi=$(echo "$wd/($wm*0.03937)" | bc)
|
|
||||||
dpi=$(printf "%.0f" $(echo "scale=1;$dpi*4/96" | bc))
|
|
||||||
dpi=$((dpi*96/4))
|
|
||||||
else
|
|
||||||
dpi=96
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build xsettingsd.local
|
# Build xsettingsd.local
|
||||||
cp ~/.config/awesome/xsettingsd ~/.config/awesome/xsettingsd.local
|
cp ~/.config/awesome/xsettingsd ~/.config/awesome/xsettingsd.local
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue