0

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.

  • I don't know about Gnome, but in Xfce it is easy to add keyboard shortcuts in Keyboard dialog. You would write a shell script in a file and write its path in the dialog. – jarno Dec 31 '20 at 15:09
  • As for checking which card you are using, see other questions such as this and this. – jarno Dec 31 '20 at 15:15
  • Do you know any scripting? This is one good starting point for learning Bash scripting. – jarno Dec 31 '20 at 15:26
  • Related: https://askubuntu.com/questions/1185518/xbindkeys-launches-correctly-application-for-the-first-time-only/1187061#1187061 – Raffa Dec 31 '20 at 15:47

0 Answers0