You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

NixOS系统LightDM+XMonad环境下DPI缩放问题求助

Hey Jordan, let's sort out those annoying HiDPI cursor and TTY font issues you're dealing with. Since your terminal and Firefox are scaling correctly, we just need to target the cursor and console specifically—here's how to fix them:

Fixing HiDPI Cursor Size and Lag

First up, the tiny cursor and sluggish movement. There are two reliable ways to address this:

This ensures the cursor setting applies as soon as X starts (even before lightdm logs you in). Create a new config file in /etc/X11/xorg.conf.d/:

sudo nano /etc/X11/xorg.conf.d/90-hidpi-cursor.conf

Paste this content, adjusting the CursorSize value to match your screen's DPI (48 is a good starting point for 2x HiDPI; tweak up/down if needed):

Section "InputClass"
    Identifier "hidpi-cursor"
    MatchIsPointer "on"
    Option "CursorSize" "48"
    # Fix cursor lag by disabling acceleration (adjust AccelSpeed if you prefer some)
    Option "AccelerationProfile" "2"
    Option "AccelerationScheme" "none"
    Option "AccelSpeed" "0.0"
EndSection

Save the file and restart your system—your cursor should be properly scaled and move smoothly afterward.

Xmonad Startup Hook Alternative

If you prefer to handle this directly in your xmonad config, add this to your xmonad.hs startup hook to set the cursor size on login:

import XMonad.Util.SpawnOnce

myStartupHook = do
    spawnOnce "xsetroot -cursor_size 48"
    -- Keep your other startup commands here

Recompile xmonad (xmonad --recompile) and restart it, and the cursor size will update immediately.

Fixing Tiny TTY Font Size

For the default TTY font, we can adjust the console font settings to scale with your HiDPI screen:

Using console-setup (Debian/Ubuntu-based systems)

  1. Edit the console setup config:
sudo nano /etc/default/console-setup
  1. Update these values (adjust FONTSIZE to fit your screen—12x24 or 16x32 work well for HiDPI):
FONTFACE="Terminus"
FONTSIZE="12x24"
  1. Apply the changes without rebooting:
sudo dpkg-reconfigure console-setup

When prompted, select your encoding (usually UTF-8) and confirm the font settings.

Using vconsole.conf (Systemd-based systems)

If you're using systemd, edit /etc/vconsole.conf:

sudo nano /etc/vconsole.conf

Add a line specifying a scaled font (e.g., Terminus 32pt):

FONT=ter-v32n

Apply the changes with:

sudo systemctl restart systemd-vconsole-setup

Now your TTY fonts will be large enough to read comfortably.


内容的提问来源于stack exchange,提问作者Jordan Mackie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:22:23