mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Enable HiDPI support only if the framebuffer size is detectable
This commit is contained in:
@@ -687,16 +687,31 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then
|
|||||||
systemctl start systemd-networkd-wait-online
|
systemctl start systemd-networkd-wait-online
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# enable hiDPI support
|
# Enable HiDPI support only if the framebuffer size is detectable
|
||||||
if [[ "$(cut -d, -f1 < /sys/class/graphics/fb0/virtual_size 2> /dev/null)" -gt 1920 ]]; then
|
FB_VIRTUAL_SIZE="/sys/class/graphics/fb0/virtual_size"
|
||||||
# lightdm
|
HIDPI_THRESHOLD="1920"
|
||||||
[[ -f /etc/lightdm/slick-greeter.conf ]] && echo "enable-hidpi = on" >> /etc/lightdm/slick-greeter.conf
|
if [[ -r "$FB_VIRTUAL_SIZE" ]]; then
|
||||||
# xfce
|
fb_virtual_width=$(cut -d, -f1 < "$FB_VIRTUAL_SIZE" 2>/dev/null)
|
||||||
[[ -f /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml ]] && sed -i 's|<property name="WindowScalingFactor" type="int" value=".*|<property name="WindowScalingFactor" type="int" value="2">|g' /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
|
if [[ "$fb_virtual_width" =~ ^[0-9]+$ && "$fb_virtual_width" -gt "${HIDPI_THRESHOLD}" ]]; then
|
||||||
|
# Enable HiDPI in LightDM slick-greeter
|
||||||
|
if [[ -f /etc/lightdm/slick-greeter.conf ]]; then
|
||||||
|
if ! grep -q "^enable-hidpi *= *on" /etc/lightdm/slick-greeter.conf; then
|
||||||
|
echo "enable-hidpi = on" >> /etc/lightdm/slick-greeter.conf
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# framebuffer console larger font
|
# Set XFCE scaling factor in skeleton config
|
||||||
|
XFCE_XSETTINGS="/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml"
|
||||||
|
if [[ -f "$XFCE_XSETTINGS" ]]; then
|
||||||
|
sed -i 's|\(<property name="WindowScalingFactor" type="int" value="\)[^"]*\(">\)|\12\2|' "$XFCE_XSETTINGS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set a larger console font for framebuffer
|
||||||
|
if [[ -f /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz ]]; then
|
||||||
setfont /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz
|
setfont /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user