marsevilspirit's blog

命令行调节屏幕亮度

由于不知为什么, 我的arch linux的KDE亮度调节UI不好使,就是一个摆设。

我也懒得去搞,在这里总结一下用命令行调节亮度的方法。

因为我是用的是X11啊,所以用了xrandr这个命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mars:~/ $ xrandr                                                                    
Screen 0: minimum 8 x 8, current 2560 x 1600, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 connected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 16mm x 10mm
2560x1600 60.00 + 240.00*
HDMI-0 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-6 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

可以看到有一个是connected状态,所以我们要调节DP-2的亮度(X为调节的亮度大小,推荐0.1~1之间):

1
mars:~/ $ xrandr --output DP-2 --brightness X

Sep 2024