2

First of all, I should clarify that I am attempting to run version 20.04 on a Chromebook. The hotkeys of a Chromebook become function keys when replacing ChromeOS with Ubuntu.

If I am using Kubuntu, there are readily-available settings to remap the keyboard shortcuts for brightness changing. I am aware that the default version of Ubuntu 20.04 also has a settings panel for remapping keyboard shortcuts.

However, unlike the KDE desktop, the default version of Ubuntu does not have the brightness change option as one of the default keyboard shortcuts, and therefore, I will have to type the command myself. I have tried doing this, but I am not satisfied with the result.

When I remap the keyboard shortcut on KDE, I am able to incrementally increase the brightness as I wish. But in the default version of Ubuntu, with the commands I have put in, I am only able to set a Low brightness, and a High brightness. I can set nothing in between.

This might be due to my limited knowledge. May I know if there is an approach in which I can set a command to incrementally increase brightness, and another to incrementally decrease brightness? In other words, is there a command I can enter such that the brightness is decreased or increased by 0.1 points?

If there is no such command, is it possible to do the same thing by writing a script instead?

Brightness changing command testing

Najeed
  • 321

2 Answers2

2

Workaround

for increasing by 0.1 add the below command as custom keyboard shortcut

sh -c 'gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp && gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp'

for decreasing by 0.1

sh -c 'gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown && gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown'

Note: set the brightness by zero or 100 via GUI for the first time and then use the keyboard shortcuts to have perfect multiples of 10

PRATAP
  • 22,460
1

This is a repost of my old answer from here

I am on 20.04 and I used dconf-editor to adjust the screen brightness from keyboard shortcuts.

Open dconf-editor and search for screen-brightness-up and screen-brightness-down, and under custom-value change the value to the shortcut you want to set (will tell later how to know what to enter).

enter image description here

I don't know the exact syntax followed by dconf-editor, but I will tell you how to find the syntax. Head over to settings > Keyboard shortcuts. Now search for volume up, and choose the shortcut which you want to use for screen brightness up. Then head over to dconf editor and search for volume-up, and now see the string in the custom value for volume-up, and now copy paste this string to the screen-brightness-up > custom value field. We have to do this as we can access the shortcuts for volume and not for brightness.

So we manipulate the value for volume from settings and then use that value for screen-brightness-up in the dconf editor. And then remove that custom value from dconf-edtor for volume-up (or set it back to its previous value).

Hope this helps. I was finding this for a very long time and the other answer didn't work for me, but I was finally able to figure this hack out, and hopes this helps many other people.

Abhay Patil
  • 2,705