i3wm下调节分辨率及其刷新率

发布时间 2023-07-08 19:20:50作者: 凡璞

查看和调节显示器的分辨率使用xrandr命令
我们一般需要先查看当前的显示器及其情况再去设置调节

查看当前显示器及其情况

直接在终端输入xrandr即可;输出如下:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767  
HDMI-0 disconnected (normal left inverted right x axis y axis)  
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 600mm x 340mm  
  2560x1440     59.95 + 144.01   120.00    99.95     
  1920x1080    119.88   100.00    60.00    59.94*   50.00     
  1440x900      59.89     
  1440x576      50.00     
  1440x480      59.94     
  1280x1024     75.02    60.02     
  1280x720      59.94    50.00     
  1152x864      75.00     
  1024x768      75.03    70.07    60.00     
  800x600       75.00    72.19    60.32    56.25     
  720x576       50.00     
  640x480       75.00    72.81    59.94     
DP-1 disconnected (normal left inverted right x axis y axis)  
DP-2 disconnected (normal left inverted right x axis y axis)  
DP-3 disconnected (normal left inverted right x axis y axis)  
DP-4 disconnected (normal left inverted right x axis y axis)  
DP-5 disconnected (normal left inverted right x axis y axis)

上述显示了,我只连接了一个显示器,使用的接口是DP,该显示器的编号是DP-0
当前使用的分辨率是1920x1080,分辨率使用的是59.94 (看*号)

设置分辨率及其刷新率

常用的命令格式如下:

// 将显示器分辨率设置为:2560x1440;刷新率设置为144.01
xrandr --output DP-0 --mode 2560x1440 --rate 144.01
  • 通过--output 指定设置哪个显示器
    指定完output后,可以通过子参数设定该显示器的参数:
    • --mode:设置分辨率
    • --rate:设置刷新率
      若是需要设置这个窗口为主窗口的话,添加参数:--primary