用键盘快捷键控制显示器亮度?

我可以通过以下命令控制与HDMI连接的DELL S2216H的亮度:

ddccontrol -p -r 0x10 -w 53 

在这个例子中,数字53代表亮度等级(范围0到100)。 但是我不知道如何将命令链接到键盘上的亮度键或者在Gnome-panel中的音量控制旁边添加滑块等滑块

在搜索该主题时,我读到了这个问题通过软件控制外部显示器亮度,但该问题的接受答案并没有解决我的问题

我的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  currval = int(next(obj for obj in section if obj.startswith("value")).split("=")[-1].strip(",")) StopIteration 

更新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 : 

更新3即使第一个命令现在不工作,我怎么能让它工作?

笔记本电脑中的亮度滑块