forked from colonelpanic/dotfiles
[Linux] Add xsettingsd-setup
This commit is contained in:
parent
9741b2042a
commit
be7b00cf32
25
dotfiles/lib/bin/xsettingsd-setup
Executable file
25
dotfiles/lib/bin/xsettingsd-setup
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Don't try to guess DPI. For a laptop, we don't want the same DPI as
|
||||
# for an external screen. Just hardcode stuff...
|
||||
case $(hostname),$(xrandr --current | \
|
||||
sed -n 's/\([^ ]*\) connected .*[0-9][0-9]*x[0-9][0-9]*+[0-9][0-9]*+[0-9][0-9]* .*/\1/p' | \
|
||||
sort | tr '\n' ':') in
|
||||
# imalison-arch,DVI-D-0:HDMI-0:) dpi=144 ;;
|
||||
*) dpi=${1:-144} ;;
|
||||
esac
|
||||
|
||||
# Build xsettingsd.local
|
||||
cp ~/.xsettingsd ~/.xsettingsd.local
|
||||
echo Xft/DPI $(( $dpi * 1024 )) >> ~/.xsettingsd.local
|
||||
|
||||
# Signal xsettingsd
|
||||
pid=$(xprop -name xsettingsd _NET_WM_PID 2> /dev/null | awk '{print $NF}')
|
||||
if [ x"$pid" = x ]; then
|
||||
xsettingsd -c ~/.xsettingsd.local &
|
||||
else
|
||||
kill -HUP $pid
|
||||
fi
|
||||
|
||||
# # Also use xrdb for very old stuff (you know, LibreOffice)
|
||||
# echo Xft.dpi: "$dpi" | xrdb -merge
|
Loading…
Reference in New Issue
Block a user