Sum*_*ukh 5 gnome keyboard shortcut-keys brightness dell
我可以通过以下命令控制连接 HDMI 的 DELL S2216H 的亮度:
ddccontrol -p -r 0x10 -w 53
Run Code Online (Sandbox Code Playgroud)
在此示例中,数字 53 表示亮度级别(范围 0 到 100)。但我不知道如何将命令链接到我键盘上的亮度键,或者在 Gnome 面板中的音量控制旁边添加类似笔记本电脑的滑块
在搜索该主题时,我阅读了此问题 通过软件控制外部显示器亮度, 但该问题的公认答案并不能解决我的问题
我的输出ddccontrol -p
是在这里发布在 pastebin
UPDATE 尝试了第一个解决方案。
python3 /home/sumeet/set_brightness.py up
No monitor supporting DDC/CI available.
If your graphics card need it, please check all the required kernel modules are loaded (i2c-dev, and your framebuffer driver).
Traceback (most recent call last):
File "/home/sumeet/set_brightness.py", line 22, in <module>
currval = int(next(obj for obj in section if obj.startswith("value")).split("=")[-1].strip(","))
StopIteration
Run Code Online (Sandbox Code Playgroud)
更新 2
根据我的理解,这个脚本的输出甚至没有检测到我的显示器。但第一个(原始)命令仍然有效
python3 /home/sumeet/brightness.py
No monitor supporting DDC/CI available.
If your graphics card need it, please check all the required kernel modules are loaded (i2c-dev, and your framebuffer driver).
ddccontrol version 0.4.2
Copyright 2004-2005 Oleg I. Vdovikin (oleg@cs.msu.su)
Copyright 2004-2006 Nicolas Boichat (nicolas@boichat.ch)
This program comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of this program under the terms of the GNU General Public License.
Probing for available monitors.......
Detected monitors :
Run Code Online (Sandbox Code Playgroud)
更新 3 即使第一个命令现在也不起作用,我怎样才能让它工作?
Gnome 允许您绑定任意键来运行您选择的命令。如果xbacklight
有效,我建议您使用它。既然您说没有,您可以使用brightness
我将在下面包含的脚本。
brightness +10
brightness -10
.许多外接显示器无法控制背光灯xbacklight
。但您仍然可以使用软件控制亮度。这是我编写的脚本,它可以做到这一点。
#!/bin/bash\n# brightness: Change all monitors brightness in software.\n# by hackerb9, 2019\n\n# Examples: brightness 75; brightness -5; brightness +10\n# Usage:\n# brightess [n] [+n] [-n]\n# n An integer from 0 to 100 specifies a brightness level.\n# +n Increase brightness by n.\n# -n Decrease brightness by n.\n# No argument shows current brightness level.\n\nb=$(xrandr --current --verbose | grep Brightness)\nb=${b#*: } # Remove "Brightness: "\nb=${b#0.} # 0.30 --> 30\n[[ $b == "1.0" ]] && b="100"\ncase $1 in\n +*|-*)\n b=$((b $1)) # b=b+10, b=b-10\n ;;\n [0-9]*)\n b=$1 # b=75\n ;;\n *)\n echo $b; exit\n ;;\nesac\n\n[[ $b -lt 0 ]] && b=0\n[[ $b -gt 100 ]] && b=100\n\nif [[ $b -eq 100 ]]; then\n b=1.0\nelse\n b=0.$b\nfi\n\noutputs=$(xrandr --current | awk \'$2 == "connected" {print $1}\')\nfor o in $outputs; do\n xrandr --output $o --brightness $b\ndone \n
Run Code Online (Sandbox Code Playgroud)\n\n要安装该脚本,请将其粘贴到名为 的文件中brightness
,将其设置为可执行文件,然后将其放入您的路径中。或者,您可以剪切并粘贴这些命令:
如果对您有用,您可以使用它作为上述说明中的xbacklight
直接替代品。brightness
(xbacklight +10
亮度升高,xbacklight -10
亮度降低。)
归档时间: |
|
查看次数: |
2598 次 |
最近记录: |