linux 显示器分辨率设置太小了,显示器不显示 如何在设置回来,当“显示设置”中的分辨率不可用时,如何使用xrandr设置自定义分辨率...

本文指导如何使用xrandr和gtf工具添加并应用自定义显示器分辨率,如1920x1080@60Hz。首先,通过gtf获取模型字符串,然后用xrandr创建新模式,接着将新模式添加到指定显示设备(例如VGA1),最后应用新设置。如果需要,可使用脚本自动化整个过程。
摘要由CSDN通过智能技术生成

您需要执行以下步骤来添加新的自定义分辨率并应用它。以下步骤用于添加1920x1080分辨率,但是您可以将其用于任何其他所需的分辨率。但是请确保您的显示器和板载图形支持该分辨率。

# First we need to get the modeline string for xrandr

# Luckily, the tool "gtf" will help you calculate it.

# All you have to do is to pass the resolution & the-

# refresh-rate as the command parameters:

gtf 1920 1080 60

# In this case, the horizontal resolution is 1920px the

# vertical resolution is 1080px & refresh-rate is 60Hz.

# IMPORTANT: BE SURE THE MONITOR SUPPORTS THE RESOLUTION

# Typically, it outputs a line starting with "Modeline"

# e.g. "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync

# Copy this entire string (except for the starting "Modeline")

# Now, use "xrandr" to make the system recognize a new

# display mode. Pass the copied string as the parameter

# to the --newmode option:

xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync

# Well, the string within the quotes is the nick/alias

# of the display mode - you can as well pass something

# as "MyAwesomeHDResolution". But, careful! :-|

# Then all you have to do is to add the new mode to the

# display you want to apply, like this:

xrandr --addmode VGA1 "1920x1080_60.00"

# VGA1 is the display name, it might differ for you.

# Run "xrandr" without any parameters to be sure.

# The last parameter is the mode-alias/name which

# you've set in the previous command (--newmode)

# It should add the new mode to the display & apply it.

# Usually unlikely, but if it doesn't apply automatically

# then force it with this command:

xrandr --output VGA1 --mode "1920x1080_60.00"

我还编写了一个脚本,可以自动执行所有这些步骤。如果上述步骤对您来说太复杂了,您可以尝试一下:https : //gist.github.com/chirag64/7853413

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值