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
  • 107,489
  • possible duplicated ?? http://askubuntu.com/questions/122903/how-to-allow-key-functions-while-desktop-locked – Mohamed Slama Jun 01 '16 at 00:25
  • I don't know if that helps someone to answer but on my Ubuntu-MATE I have the same problem. I noticed that when I right click on destkop or on some applications like caja, then adjusting brightness with the Fn keys doesn't work (while disabling wifi works) so it's like the pop up from right click blocks some Fn functionality but when I right click for example at chromium then it works just fine. Can you tell me the behavior when you right click on your desktop to see if it's somehow connected? – Thanos Apostolou Jun 01 '16 at 13:10
  • @ThanosApostolou I could not reproduce your described behaviour. – Byte Commander Jun 01 '16 at 17:11
  • On Ubuntu GNOME I have this ability by default. Don't know about Unity though. –  Jul 02 '16 at 22:51
  • Ubuntu 18.4 LTS with budgie DE, same problem. It's a real pain... – Shautieh Sep 04 '18 at 21:43

2 Answers2

1

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.sh %e

and /etc/acpi/brightness.sh:

#!/bin/bash
set -e

edit this to match your device under /sys/class/backlight/

dev=amdgpu_bl0

change if you want a different number of brightness levels

levels=16

case "$1" in video/brightnessup) chg=1 ;; video/brightnessdown) chg=-1 ;; *) exit 1 ;; esac

dev="/sys/class/backlight/$dev" [[ -e "$dev" ]] 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.sh

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 > Power Management > Decrease/Increase Screen Brightness. I assume other DEs have similar ability to ignore those keys.

Walf
  • 398
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.