I am using Ubuntu 20.04 on a Dell XPS 15 7590. As you may know, my model has an OLED screen. Screen brightness functionality does not work so when I am using the intel card, I have to enter this in the terminal:
xrandr --output eDP-1 --brightness 0.5
And when I am using my NVIDIA card, I have to enter this:
xrandr --output eDP-1-1 --brightness 0.5
Is there a way I can write a script that will be invoked whenever I press Fn + F10/F11
to control the brightness? Here is a pseudocode of what I am talking about:
if card = intel:
xrandr --output eDP-1 --brightness 0.5
else:
xrandr --output eDP-1-1 --brightness 0.5
Fn + F10
is supposed to increase brightness. Fn + F11
is supposed to decrease the brightness.