1

On my old laptop, I was able to turn off the screen by pressing FN + BRIGHTNESS DOWN until it reached 0 when I was running Linux Mint. Now, I want to replicate this on Ubuntu 20.04 with Wayland, but I cannot replicate the methods shown in other posts like this and this.

  • xset dpms force off doesn't work on Wayland,
  • xrandr doesn't actually turn off the monitor backlight,
  • Setting screen saver dbus-send shows no effect and also doesn't turn off the screen,
  • echo 0 > /sys/class/backlight/intel_backlight/brightness works, but is hard to undo and might not work when switching to the NVidia card - and it requires root,
  • Locking the screen with CTRL + L also turns off the screen immediately, but it often turns itself on just a few minutes later for no obvious reason.

When I use the FN keys that control the brightness, which method is used to set the screen brightness? Wouldn't it be possible to simply modify the key binding in a way that it reduces the brightness to 0 instead of 15 (in my case)? And is it known why the screen turns itself on after a short time after being locked?

1 Answers1

0

You probably could implement a hack using the tool light, which is available in the standard Ubuntu software repositories. After installing, see "man light" to see how it works. For example, the command light -A 5 will increase brightness with 5 units.

light allows to set a minimum brightness - in your case you would set that to 0.

You could then bind the appropriate commands to your Fn+BrightnessUp/Down keys. For that, disable the default assignment first with the commands:

gsettings set org.gnome.settings-daemon.plugins.media-keys screen-brightness-up-static "['']"
gsettings set org.gnome.settings-daemon.plugins.media-keys screen-brightness-down-static "['']"

Then assign the commands to these keys using "Settings" - "Keyboard Shortcuts", "Custom Shortcuts".

To revert to the default behaviour, change set in the above commands to reset and leave out the last argument.

vanadium
  • 88,010
  • light apparently doesn't work on my device. Does it work with Wayland? I tried light -s sysfs/backlight/intel_backlight -A 5 and light -G remains at 1.00. – Green绿色 Aug 14 '22 at 23:41
  • You will of course need a tool that works on your specific system. It is perhaps wise to edit your question and add information about your hardware, specifically the graphics card. – vanadium Aug 15 '22 at 08:22