亮度调节 Fn 键在 18.04 版中停止工作

亮度调节 Fn 键在 18.04 版中停止工作

我意识到我的问题可能重复。但是,我搜索了不同的页面,但都没有解决我的问题。我最近全新安装了 Ubuntu 18.04(之前有长期版本),但就是无法让亮度键触发亮度变化。

细节:

  • Ubuntu x64 18.04。
  • 不使用 Wayland。
  • 处理器中没有集成显卡。
  • 单击电池图标时没有屏幕亮度滑块。在完全相同的硬件上,我之前安装的 Ubuntu 上有一个亮度控制器 - 为什么它隐藏在这次 Ubuntu 迭代中?
  • NVIDIA 专有驱动程序的使用如下图所示:

在此处输入图片描述

中央处理器:

*-cpu
          description: CPU
          product: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
          bus info: cpu@0
          version: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
          capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp cpufreq

图形处理器:

sudo lshw -C display
  *-display                 
       description: VGA compatible controller
       product: GP106M [GeForce GTX 1060 Mobile]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:122 memory:dd000000-ddffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:e000(size=128) memory:c0000-dffff

这是我当前的 grub 配置:

GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"

启用这些设置后(设置后我确实重新启动了 grub 和系统),我可以听到 Fn+Brightness 组合:

acpi_listen 
video/brightnessdown BRTDN 00000087 00000000
video/brightnessup BRTUP 00000086 00000000

这样,我至少知道按下亮度更改键(通过Fn加号F8降低亮度或F9加号提高亮度)会被系统识别。如果我没记错的话,这些事件应该会触发某些亮度更改脚本。

然而,虽然这些事件已被分配,但似乎什么都没有被调用。

降低亮度:video/brightnessdown BRTDN 00000087 00000000

cat /etc/acpi/events/asus-keyboard-backlight-down 
# /etc/acpi/events/asus-keyboard-backlight-down
# This is called when the user presses the key brightness 
# down button and calls /etc/acpi/asus-keyboard-backlight.sh for
# further processing.

event=video/brightnessdown BRTDN 00000087 00000000
action=/etc/acpi/asus-keyboard-backlight.sh down

亮度增加:video/brightnessup BRTUP 00000086 00000000

cat /etc/acpi/events/asus-keyboard-backlight-up
# /etc/acpi/events/asus-keyboard-backlight-up
# This is called when the user presses the key brightness 
# up button and calls /etc/acpi/asus-keyboard-backlight.sh for
# further processing.

event=video/brightnessup BRTUP 00000086 00000000
action=/etc/acpi/asus-keyboard-backlight.sh up

这两个事件都定义为行动以下文件:

vim /etc/acpi/asus-keyboard-backlight.sh

其内容如下:

KEYS_DIR=/sys/class/leds/phy0-led\:\:kbd_backlight


test -d $KEYS_DIR || exit 0

MIN=0
MAX=$(cat $KEYS_DIR/max_brightness)
VAL=$(cat $KEYS_DIR/brightness)

if [ "$1" = down ]; then
        VAL=$((VAL-1))
else
        VAL=$((VAL+1))
fi

if [ "$VAL" -lt $MIN ]; then
        VAL=$MIN
elif [ "$VAL" -gt $MAX ]; then
        VAL=$MAX
fi

echo $VAL > $KEYS_DIR/brightness

此外,如果我检查变量中的目录$KEYS_DIR,主要有以下内容:

sudo ls /sys/class/leds/phy0-led
brightness  device  max_brightness  power  subsystem  trigger  uevent

亮度最大亮度文件是空的。

一切似乎都设置正确,但我不明白为什么亮度没有变化,为什么如果我使用其他程序,比如亮度控制器或者x背光为什么亮度滑块不见了?

非常感谢。

答案1

在 Xubuntu 18.04(带有 xfce 桌面的 Ubuntu)上我的亮度问题终于解决了。

我在“设置”菜单下打开了“板载设置”。如果你的桌面没有,你可以从软件中心下载。

在“板载首选项”窗口中,单击布局菜单,然后选择“全键盘”(带有编辑和功能键的桌面键盘)。单击此处查看板载首选项窗口

相关内容