How to Enable HiDPI Display Scaling on FreeBSD Operating System
Categories:
3 minute read
Introduction
High-DPI (HiDPI) displays offer significantly higher pixel density than standard displays, resulting in sharper text and clearer images. However, running a HiDPI display on FreeBSD requires manual configuration to ensure proper scaling, as the operating system does not enable automatic scaling by default. This guide provides a detailed walkthrough on enabling and optimizing HiDPI scaling on FreeBSD across different desktop environments.
Checking Display Resolution and DPI
Before configuring HiDPI scaling, determine your display’s resolution and DPI:
Open a terminal and run:
xdpyinfo | grep -B 2 resolution
This command provides details about your screen resolution and DPI settings.
Alternatively, use:
xrandr | grep '*'
This lists available resolutions for connected displays.
If your DPI is significantly higher than 96 (the standard baseline), scaling adjustments are necessary.
Adjusting HiDPI Scaling in Xorg
For users running Xorg, apply the following settings:
Modifying .xprofile
or .xsession
Edit or create
~/.xprofile
(or~/.xsession
depending on your setup):nano ~/.xprofile
Add the following line:
export GDK_SCALE=2 export GDK_DPI_SCALE=0.5
This enables GTK-based application scaling.
Apply the changes by logging out and logging back in.
Using Xrandr for Scaling
Xrandr provides on-the-fly scaling for Xorg. To enable scaling:
Identify connected displays:
xrandr --listmonitors
Set a scale factor (e.g., 2x):
xrandr --output HDMI-1 --scale 2x2
Replace
HDMI-1
with the correct output name.To make the changes persistent, add the command to
~/.xprofile
or~/.xsession
.
Configuring HiDPI in Desktop Environments
KDE Plasma
KDE Plasma provides native HiDPI scaling:
- Open System Settings.
- Navigate to Display and Monitor > Scale Display.
- Adjust the scaling factor (e.g., 150% or 200%).
- Log out and log back in for changes to take effect.
To enable fractional scaling:
kwriteconfig5 --file kdeglobals --group KDE --key ForceFontDPI 144
GNOME
GNOME supports HiDPI scaling through its Settings application:
- Open Settings.
- Go to Displays.
- Under Scale, select a scaling factor (e.g., 200%).
- Log out and log back in.
For fractional scaling, run:
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
Xfce
Xfce does not natively support HiDPI but can be configured manually:
Open Settings Manager.
Navigate to Appearance > Fonts and set DPI to 144.
Open Window Manager Tweaks > Compositor and increase UI scaling.
Apply GTK scaling:
echo 'Xft.dpi: 144' >> ~/.Xresources
Then run:
xrdb -merge ~/.Xresources
LXQt
LXQt requires manual scaling:
Open LXQt Configuration Center > Appearance.
Set font DPI to 144.
Modify Qt environment variables:
export QT_SCALE_FACTOR=2 export QT_AUTO_SCREEN_SCALE_FACTOR=1
Add these lines to
~/.xprofile
for persistence.
Adjusting Fonts and UI Elements
Some applications may require additional font and UI scaling:
Firefox: Open
about:config
, search forlayout.css.devPixelsPerPx
, and set it to2.0
.Chromium: Launch with:
chromium --force-device-scale-factor=2
GTK Applications: Modify
~/.config/gtk-3.0/settings.ini
:[Settings] gtk-font-name=Noto Sans 12 gtk-xft-dpi=144000
Conclusion
Enabling HiDPI scaling on FreeBSD requires adjusting settings at various levels, including Xorg, desktop environments, and individual applications. By following the steps outlined above, you can achieve a more visually comfortable and sharp display experience on HiDPI monitors. Adjust settings as needed to balance performance and usability.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.