在Ubuntu 18.04上使用与GNOME / Unity不同的环境时,如何调整屏幕亮度?

我在Ubuntu 18.04上使用戴尔XPS13,当我使用默认桌面环境(Unity?GNOME?)时,我可以正常使用屏幕亮度键。 但是,当我使用i3登录时,按键不再调整屏幕亮度。

我尝试过一个不同的指南,通过i3配置添加键绑定,但它依赖于使用xbacklight,当我直接安装和使用时无法调整我的屏幕亮度。

如何将此function从默认桌面环境移植到i3?

这个对我的XPS13有帮助: 显示亮度无法调整18.04

  • 通过将video.only_lcd = 0添加到GRUB_CMDLINE_LINUX_DEFAULT来更改/ etc / default / grub的内容
  • 使用sudo update-grub更新了grub

感谢@DKBose将我指向https://cialu.net/brightness-control-not-work-i3wm/ ,我能够安装一个应用程序来调整屏幕亮度并将原始屏幕亮度键映射到调用它。

首先在本地克隆repo,构建并安装它:

 git clone https://github.com/haikarainen/light.git cd light make sudo make install 

然后将键绑定添加到呼叫light并将屏幕亮度调整为i3配置:

 # my i3 config is at ~/.config/i3/config # increase screen brightness with notification bindsym XF86MonBrightnessUp exec "light -A 5; notify-send 'brightness up'" # decrease screen brightness with notification bindsym XF86MonBrightnessDown exec "light -U 5; notify-send 'brightness down'" 

重新加载i3配置以使更改生效。 默认情况下,这是$mod+Shift+c但在配置中查找命令reload以查看它为您映射的内容。