Add dynamic DPI settings
Adjust DPI settings based on display resolution.
This commit is contained in:
parent
fbf13b7ff4
commit
52b19c4d1d
7
Xresources/.Xresources.d/hidpi
Normal file
7
Xresources/.Xresources.d/hidpi
Normal file
@ -0,0 +1,7 @@
|
||||
Xft.dpi: 144
|
||||
Xft.autohint: 0
|
||||
Xft.lcdfilter: lcddefault
|
||||
Xft.hintstyle: hintfull
|
||||
Xft.hinting: 1
|
||||
Xft.antialias: 1
|
||||
Xft.rgba: rgb
|
||||
7
Xresources/.Xresources.d/lowdpi
Normal file
7
Xresources/.Xresources.d/lowdpi
Normal file
@ -0,0 +1,7 @@
|
||||
Xft.dpi: 96
|
||||
Xft.autohint: 0
|
||||
Xft.lcdfilter: lcddefault
|
||||
Xft.hintstyle: hintfull
|
||||
Xft.hinting: 1
|
||||
Xft.antialias: 1
|
||||
Xft.rgba: rgb
|
||||
7
Xresources/.Xresources.d/middpi
Normal file
7
Xresources/.Xresources.d/middpi
Normal file
@ -0,0 +1,7 @@
|
||||
Xft.dpi: 120
|
||||
Xft.autohint: 0
|
||||
Xft.lcdfilter: lcddefault
|
||||
Xft.hintstyle: hintfull
|
||||
Xft.hinting: 1
|
||||
Xft.antialias: 1
|
||||
Xft.rgba: rgb
|
||||
@ -4,3 +4,25 @@ if [ -f ~/.profile ]; then
|
||||
fi
|
||||
|
||||
xrdb -merge ~/.Xresources
|
||||
|
||||
# Load settings for HiDPI only when HiRes display is connected
|
||||
#
|
||||
SR=$(xrandr --query | grep ' connected' | egrep -o '[0-9]+x[0-9]+\+[0-9]+\+[0-9]+')
|
||||
MAX_RES=0
|
||||
for RES in $SR
|
||||
do
|
||||
SRX=$(echo $RES | cut -d'x' -f 1)
|
||||
if [ $MAX_RES -lt $SRX ]; then
|
||||
MAX_RES=$SRX
|
||||
fi
|
||||
done
|
||||
|
||||
# FullHD
|
||||
if [ $MAX_RES -le 1920 ]; then
|
||||
xrdb -merge ~/.Xresources.d/lowdpi
|
||||
# 2k
|
||||
elif [ $MAX_RES -gt 1920 || $MAX_RES -lt 2500 ]; then
|
||||
xrdb -merge ~/.Xresources.d/middpi
|
||||
elif [ $MAX_RES -gt 2500 ]; then
|
||||
xrdb -merge ~/.Xresources.d/hidpi
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user