7

Having a new Acer Aspire E17 E5-773G with Ubuntu 16.04 on it, I experience that the keyboard combinations to adjust volume (Fn + /) and brightness (Fn + /) do not work on the login screen or lock screen.

They do work when logged in though, so it's not a general problem. What do I have to do to be able to use them from the login and lock screen as well?

Byte Commander
  • 110,243

2 Answers2

2

I had the same problem and kernel parameters did not work for me. I wanted the keys to behave more like direct hardware buttons, so they worked regardless of login status, and also on tty screens. I got most of the solution via a third party site linked from this question, the various answers and comments on this question, and the Arch Wiki. In summary, this listens to ACPI events with a system service, and sets the brightness directly.

Install the acpid package:

apt install acpid

Create /etc/acpi/events/brightness:

event=video/brightness(up|down)
action=/etc/acpi/brightness %e

and /etc/acpi/brightness:

#!/bin/bash
set -e

glob used to match your device under /sys/class/backlight/

because digit suffix may change after driver updates, etc.

dev=/sys/class/backlight/amdgpu_bl*/

change if you want a different number of brightness levels

levels=16

case "$1" in video/brightnessup) chg=1 ;; video/brightnessdown) chg=-1 ;; *) echo Unexpected event >&2 exit 1 ;; esac

if ! compgen -G "$dev" > /dev/null; then echo No backlight found >&2 exit 1 fi dev=($dev) if [[ ${#dev[@]} -ne 1 ]]; then echo Multiple backlights found >&2 exit 1 fi dev=${dev[0]%/}

bri=$dev/brightness read -r cur < "$bri" read -r max < "$dev/max_brightness" max_levels=$(( max + 1 )) if (( levels < 1 )); then levels=1 elif (( levels > max_levels )); then levels=$max_levels fi incr=$(( max_levels / levels )) new=$(( cur + ( incr * chg ) )) if (( new > max )); then new=$max elif (( new < 0 )); then new=0 fi if (( new != cur )); then echo $new > "$bri" fi

and make it executable:

chmod +x /etc/acpi/brightness

Restart and enable the service:

systemctl restart acpid && systemctl enable acpid

The final piece is to stop the double-binding of the keys. In KDE Plasma, you can just disable the default bindings in System Settings > Shortcuts > Shortcuts > Power Management > Decrease/Increase Screen Brightness. Annoyingly, this must be done for every user. I assume other DEs have similar ability to configure those keys.

Walf
  • 452
0

In the terminal:

sudo gedit /etc/default/grub

Change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="

Save, then

sudo update-grub

Restart computer.