How can I set the resolution for grub, TTYs and login screen(LightDM)?

I’m using ViewSonic TD1601-4K monitor. However, the largest resolution of 3840x2160 doesn’t work. Instead, 2560x1440 works.
But grub, TTYs and login screen seems to use the largest resolution. I tried to change the resolution of TTYs by fbset, but that doesn’t work.
Correction: grub and TTYs uses 2560x1440.
inxi --admin --verbosity=7 --filter --no-host:

Summary

System:
Kernel: 6.6.10-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
clocksource: tsc avail: acpi_pm
parameters: BOOT_IMAGE=/boot/vmlinuz-6.6-x86_64
root=UUID=68e025ab-9376-4173-9a06-de4ede964e9c rw quiet splash apparmor=1
security=apparmor udev.log_priority=3
Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 wm: xfwm4 v: 4.18.0
with: xfce4-panel tools: xfce4-screensaver avail: budgie-screensaver vt: 7
dm: LightDM v: 1.32.0 Distro: Manjaro Linux base: Arch Linux
Machine:
Type: Desktop System: ASUS product: N/A v: N/A serial:
Mobo: ASUSTeK model: PRIME H610M-E D4 v: Rev 1.xx
serial: part-nu: SKU uuid:
UEFI: American Megatrends v: 0601 date: 11/22/2021
Battery:
Message: No system battery data found. Is one present?
Memory:
System RAM: total: 16 GiB available: 15.37 GiB used: 2.8 GiB (18.2%)
Message: For most reliable report, use superuser + dmidecode.
Array-1: capacity: 32 GiB slots: 2 modules: 1 EC: None
max-module-size: 16 GiB note: est.
Device-1: Controller0-ChannelA-DIMM0 type: no module installed
Device-2: Controller1-ChannelA-DIMM0 type: DDR4 detail: synchronous
size: 16 GiB speed: 3200 MT/s volts: note: check curr: 1 min: 1 max: 1
width (bits): data: 64 total: 64 manufacturer: Kingston
part-no: 9905734-082.A00G serial:
CPU:
Info: model: 12th Gen Intel Core i5-12400 bits: 64 type: MT MCP
arch: Alder Lake gen: core 12 level: v3 note: check built: 2021+
process: Intel 7 (10nm ESF) family: 6 model-id: 0x97 (151) stepping: 5
microcode: 0x32
Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
L1: 480 KiB desc: d-6x48 KiB; i-6x32 KiB L2: 7.5 MiB desc: 6x1.2 MiB
L3: 18 MiB desc: 1x18 MiB
Speed (MHz): avg: 800 min/max: 800/4400 scaling: driver: intel_pstate
governor: powersave cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800
8: 800 9: 800 10: 800 11: 800 12: 800 bogomips: 59916
Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
arch_capabilities arch_lbr arch_perfmon art avx avx2 avx_vnni bmi1 bmi2
bts cat_l2 cdp_l2 clflush clflushopt clwb cmov constant_tsc cpuid
cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est
f16c flexpriority flush_l1d fma fpu fsgsbase fsrm fxsr gfni hfi ht hwp
hwp_act_window hwp_epp hwp_notify hwp_pkg_req ibpb ibrs ibrs_enhanced ibt
ida intel_pt invpcid lahf_lm lm mca mce md_clear mmx monitor movbe
movdir64b movdiri msr mtrr nonstop_tsc nopl nx ospke pae pat pbe
pclmulqdq pdcm pdpe1gb pebs pge pku pln pni popcnt pse pse36 pts rdpid
rdrand rdseed rdt_a rdtscp rep_good sdbg sep serialize sha_ni smap smep
split_lock_detect ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm
tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer tsc_known_freq umip
user_shstk vaes vme vmx vnmi vpclmulqdq vpid waitpkg x2apic xgetbv1 xsave
xsavec xsaveopt xsaves xtopology xtpr
Vulnerabilities:
Type: gather_data_sampling status: Not affected
Type: itlb_multihit status: Not affected
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: mmio_stale_data status: Not affected
Type: retbleed status: Not affected
Type: spec_rstack_overflow status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
sanitization
Type: spectre_v2 mitigation: Enhanced / Automatic IBRS, IBPB:
conditional, RSB filling, PBRSB-eIBRS: SW sequence
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: Intel Alder Lake-S GT1 [UHD Graphics 730] vendor: ASUSTeK
driver: i915 v: kernel arch: Gen-12.2 process: Intel 10nm built: 2021-22+
ports: active: HDMI-A-2 empty: DP-1,DP-2,HDMI-A-1 bus-ID: 00:02.0
chip-ID: 8086:4692 class-ID: 0300
Display: x11 server: X.org v: 1.21.1.10 with: Xwayland v: 23.2.3
compositor: xfwm4 v: 4.18.0 driver: X: loaded: modesetting
alternate: fbdev,vesa dri: iris gpu: i915 display-ID: :0.0 screens: 1
Screen-1: 0 s-res: 2560x1440 s-size: <missing: xdpyinfo>
Monitor-1: HDMI-A-2 mapped: HDMI-2 model: RTK UHD HDR serial:
built: 2016 res: 2560x1440 hz: 60 dpi: 109 gamma: 1.2
size: 596x335mm (23.46x13.19") diag: 685mm (27") ratio: 16:9 modes:
max: 3840x2160 min: 720x400
API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
device: 1 drv: swrast surfaceless: drv: iris x11: drv: iris
inactive: gbm,wayland
API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 23.3.3-manjaro1.1
glx-v: 1.4 direct-render: yes renderer: Mesa Intel UHD Graphics 730 (ADL-S
GT1) device-ID: 8086:4692 memory: 15.01 GiB unified: yes
Audio:
Device-1: Intel Alder Lake-S HD Audio vendor: ASUSTeK driver: snd_hda_intel
v: kernel alternate: snd_sof_pci_intel_tgl bus-ID: 00:1f.3
chip-ID: 8086:7ad0 class-ID: 0403
API: ALSA v: k6.6.10-1-MANJARO status: kernel-api with: aoss
type: oss-emulator tools: alsactl,alsamixer,amixer
Server-1: JACK v: 1.9.22 status: off tools: N/A
Server-2: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Wi-Fi 6 AX210/AX211/AX411 160MHz driver: iwlwifi v: kernel
pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: 01:00.0 chip-ID: 8086:2725
class-ID: 0280
IF: wlp1s0 state: up mac:
IP v4: type: dynamic noprefixroute scope: global
broadcast:
IP v6: type: dynamic noprefixroute scope: global
IP v6: type: dynamic noprefixroute scope: global
IP v6: type: dynamic noprefixroute scope: global
IP v6: type: noprefixroute scope: global
IP v6: type: noprefixroute scope: link
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: ASUSTeK PRIME B450M-A driver: r8169 v: kernel pcie: gen: 1
speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 03:00.0 chip-ID: 10ec:8168
class-ID: 0200
IF: enp3s0 state: down mac:
WAN IP:
Bluetooth:
Device-1: Intel AX210 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-6:2 chip-ID: 8087:0032
class-ID: e001
Report: rfkill ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
rfk-block: hardware: no software: yes address: see --recommends
Logical:
Message: No logical block device data found.
RAID:
Hardware-1: Intel Volume Management Device NVMe RAID Controller driver: vmd
v: 0.6 port: N/A bus-ID: 00:0e.0 chip-ID: 8086:467f rev: class-ID: 0104
Drives:
Local Storage: total: 983.17 GiB used: 97.9 GiB (10.0%)
SMART Message: Required tool smartctl not installed. Check --recommends
ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 850 PRO 1TB
size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: fw-rev: 2B6Q scheme: GPT
ID-2: /dev/sdb maj-min: 8:16 vendor: Kingston model: DataTraveler 3.0
size: 29.3 GiB block-size: physical: 512 B logical: 512 B type: USB rev: 3.0
spd: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 tech: N/A serial:
fw-rev: PMAP scheme: MBR
Message: No optical or floppy data found.
Partition:
ID-1: / raw-size: 248.37 GiB size: 243.41 GiB (98.00%)
used: 27.9 GiB (11.5%) fs: ext4 dev: /dev/sda1 maj-min: 8:1 label: N/A
uuid: 68e025ab-9376-4173-9a06-de4ede964e9c
ID-2: /boot/efi raw-size: 1.05 GiB size: 1.05 GiB (99.80%)
used: 5.4 MiB (0.5%) fs: vfat dev: /dev/sda2 maj-min: 8:2 label: N/A
uuid: 0F68-0470
ID-3: /home raw-size: 100.42 GiB size: 687.87 GiB (685.00%)
used: 70 GiB (10.2%) fs: btrfs dev: /dev/sda5 maj-min: 8:5 label: N/A
uuid: 3be9b65c-5aef-4691-b62d-01a0f68e8e88
Swap:
Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
compressor: zstd max-pool: 20%
ID-1: swap-1 type: partition size: 16 GiB used: 0 KiB (0.0%) priority: -2
dev: /dev/sda7 maj-min: 8:7 label: N/A
uuid: be282149-50a4-41e8-a355-ddcba3b2a4eb
Unmounted:
ID-1: /dev/sda3 maj-min: 8:3 size: 600 MiB fs: swap label: N/A
uuid: f80d2c01-cb4b-4b1e-826b-d50c0c43c766
ID-2: /dev/sda4 maj-min: 8:4 size: 384 GiB fs: btrfs label: N/A
uuid: 3be9b65c-5aef-4691-b62d-01a0f68e8e88
ID-3: /dev/sda6 maj-min: 8:6 size: 203.45 GiB fs: btrfs label: N/A
uuid: 3be9b65c-5aef-4691-b62d-01a0f68e8e88
ID-4: /dev/sdb1 maj-min: 8:17 size: 29.26 GiB fs: exfat label: Ventoy
uuid: 8269-377C
ID-5: /dev/sdb2 maj-min: 8:18 size: 32 MiB fs: vfat label: VTOYEFI
uuid: B2C8-40D2
USB:
Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 16 rev: 2.0
speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
class-ID: 0900
Device-1: 1-6:2 info: Intel AX210 Bluetooth type: bluetooth driver: btusb
interfaces: 2 rev: 2.0 speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1
power: 100mA chip-ID: 8087:0032 class-ID: e001
Device-2: 1-9:3 info: SHARKOON GmbH 2.4GHz Wireless rechargeable vertical
mouse [More&Better] type: mouse driver: hid-generic,usbhid interfaces: 1
rev: 1.1 speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 power: 100mA
chip-ID: 1ea7:0064 class-ID: 0301
Device-3: 1-14:4 info: Dell KB216 Wired Keyboard type: keyboard,HID
driver: hid-generic,usbhid interfaces: 2 rev: 2.0
speed: 1.5 Mb/s (183 KiB/s) lanes: 1 mode: 1.0 power: 100mA
chip-ID: 413c:2113 class-ID: 0300
Hub-2: 2-0:1 info: super-speed hub ports: 4 rev: 3.1
speed: 20 Gb/s (2.33 GiB/s) lanes: 2 mode: 3.2 gen-2x2 chip-ID: 1d6b:0003
class-ID: 0900
Device-1: 2-2:2 info: Kingston DataTraveler 100 G3/G4/SE9 G2/50 Kyson
type: mass storage driver: usb-storage interfaces: 1 rev: 3.0
speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 power: 504mA
chip-ID: 0951:1666 class-ID: 0806 serial:
Sensors:
System Temperatures: cpu: 38.0 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Processes: 351 Power: uptime: 6m states: freeze,mem,disk suspend: deep
avail: s2idle wakeups: 0 hibernate: platform
avail: shutdown,reboot,suspend,test_resume image: 6.13 GiB
daemons: upowerd,xfce4-power-manager Init: systemd v: 255
default: graphical tool: systemctl
Packages: pm: pacman pkgs: 1315 libs: 375 tools: pamac,yay pm: flatpak
pkgs: 0 Compilers: clang: 16.0.6 gcc: 13.2.1 Shell: Zsh v: 5.9
running-in: xfce4-terminal inxi: 3.3.32

check the internet for the phrase
“grub screen resolution”
for editing the grub-config.
make sure to run

sudo mkinitcpio -P
sudo update-grub

to make the changes valid

edit /etc/default/grub

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto

Save the file and rebuild the config (update-grub script is a wrapper around the command)

sudo grub-mkconfig -o /boot/grub/grub.cfg

My /etc/default/grub:

[...]
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=2560x1080,auto
[...]

So you can set the resolution. However, I followed this:

And, I might be misremembering, but I almost think early KMS was necessary for this:

https://wiki.archlinux.org/title/Kernel_mode_setting#Early_KMS_start

Login-Screen (example for GDM):
sudo cp ~/.config/monitors.xml /var/lib/gdm/.config/
sudo chown gdm:gdm /var/lib/gdm/.config/monitors.xml
Resolution: HDMI mostly lower resolution than DP.

I solved the third problem (login screen) by doing this:

  1. create /usr/share/lightdmxrandr.sh, contains xrandr -s 2560x1440.
  2. chown lightdm:lightdm /usr/share/lightdmxrandr.sh
  3. chmod +x /usr/share/lightdmxrandr.sh
  4. edit /etc/lightdm/lightdm.conf like this:
    [Seat:*]
    display-setup-script=/usr/share/lightdmxrandr.sh
    The first two problems seems to be same.
1 Like