Ändern Sie die Ubuntu-Helligkeit mit der externen Tastatur

558

Ich habe einen HP Pavilion G6 Laptop. Meine Tastatur funktioniert nicht mehr, daher kann ich die Laptoptastatur nicht zum Ändern der Helligkeit verwenden. Das Problem ist, dass meine Helligkeit auf 0 eingestellt ist, sodass ich nichts mehr sehen kann, wenn Ubuntu geladen wird. Ich habe eine externe Tastatur über USB angeschlossen. Ich habe mich gefragt, wie ich die Helligkeit mit der externen Tastatur ändern kann. Gibt es einen Weg. Ich kann mich nicht einloggen oder sehen, wenn ubuntu auf dem Anmeldebildschirm vollständig dunkel geladen ist.

Jede Hilfe wird geschätzt.

0

1 Antwort auf die Frage

1
gbc921

I would recommend that you create a script that changes the brightness and sets up Gnome keyboard shortcuts (assuming that you are using Gnome/Cinnamon) that will activate that script for you.

I have my script set like this:

#!/bin/bash echo $1 > /sys/class/backlight/acpi_video0/brightness 

It will get the number called when the script is executed as root/sudo/gksu and set it as the brightness. The number can vary from 0 to 15, but I think this can vary from display to display if my memory is not misleading me.

For setting the brightness, you can either call the scripts with different numbers and many keys on the keyboard (lazy way \o/) or implement two for loops (smarter way).

These for loops could be called by the $1 parameter that inside a switch case will redirect to the for loop that increase or decrease the brightness (going from 0 to 15 and 15 to 0). Then you just set on keyboard shortcuts two keys that will call the parameter to each for in the switch/if case.


If you need more control to the "brightness" you can use this command instead, in the same way as above:

/sys/class/backlight/intel_backlight/brightness

This varies from 0 to 4000 (or something near that) and actually controls the back-light, putting your display with really no light when set to zero.