On Thursday 11 July 2019 11:40:33 pm David C. Rankin wrote:
On 07/11/2019 04:35 PM, Mike Bird wrote:
On Thu July 11 2019 14:28:29
andre_debian(a)numericable.fr wrote:
On my laptop computer , the keys F11 and F12,
adjusts the brightness of the screen.
But on Debian-Stretch with trinity, these two keys do nothing.
I can't help you with F11 and F12 but if it's a 70% brightness
you want you can put "xbacklight -set 70" in a file called
".xsessionrc" in your home directory.
You can also check for an interface through, e.g.
/sys/class/backlight/acpi_video0/
or e.g.
/sys/class/backlight/intel/
within each directory you should have a sysfs structure for 'brightness'
and 'max_brightness'
For example, you can check the current and max brightness with:
cat /sys/class/backlight/acpi_video0/brightness
cat /sys/class/backlight/acpi_video0/max_brightness
To set, you must be root (or EUID 0 with sudo, etc..) and
echo 5 > /sys/class/backlight/acpi_video0/brightness
I just use a script that reads the last set value from
/usr/local/share/brightness on startup (set in ~/.kde/Autostart) and use an
alias to the script `bl` that then allows adjustment with `bl +` or `bl -`
or `bl value`.
You can also end up in the circumstance where your F11/F12 are actually
setting the values in:
/sys/class/backlight/acpi_video0/brightness
but your video driver (e.g. Nvidia, etc..) is using
/sys/class/backlight/nvidiabl/brightness
In that case you can use a similar script at startup to background a watch
with inotifywait that watches .../acpi_video0/brightness and then sets
.../nvidiabl/brightness whenever it changes.
Bottom line, few desktops actually have interfaces to manufacturer keyboard
mappings for specific hardware hotkeys. (plasma -- hiss, seems to do better
than others) Some distros used to provide specific packages, and KDE used
to have for example Sony hotkeys package and a few others. But that is they
type of package that must be maintained with every new crop of laptops.
(e.g. Sony hotkeys doesn't mean a whole lot anymore...) So mapping your own
key to the feature you use to control brightness is probably the only
reliable way to make sure they work.
I've used GUI tools that will show you key identifiers. Alas, I didn't take
notes of what it was. It was related to:
xbindkeys
xbindkeys-config
xdotool
Found it! xev (from a command line)
See the thread "How to use mouse click as part of a keyboard shortcut?"
(Jun/July 2018) for more info on how to map the keypress to an action.
Best,
Michael