Date: Fri, 5 Jul 2024 02:18:10 +0300 From: Anton Shepelev <anton.txt@gmail.com> To: freebsd-stable@freebsd.org Subject: Re: Need help controlling laptom display brightness via sysctl Message-ID: <20240705021810.f58cad5f961b7e5b7968e2db@gmail.com> References: <20240704010029.75608a4e49205eb38a6034be@gmail.com> <20240705005834.4c7983ea29da3af8f8e36718@gmail.com> <CAN6yY1uo%2Be6pY1H7JSyHKjjbB8O6a_UAoW=NoagzXSCc%2BHzaHQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Kevin Oberman: > This is what I used. I have it in /etc/devd/thinkpad.conf. > > notify 100 { > match "system" "ACPI"; > match "subsystem" "IBM"; > match "notify" "0x10"; > action "/usr/bin/backlight +"; > }; > > notify 100 { > match "system" "ACPI"; > match "subsystem" "IBM"; > match "notify" "0x11"; > action "/usr/bin/backlight -"; > }; > > 10% changes are more reasonable than 1%. The top two > "notify"s set the screen at 100% on AC and 40% on battery. I fear you missed my point that HP seems to have a different approach to these ACPI events. In ThinkPad, the up- and down-brighness events have fixed notify codes: 0x10 and 0x11. In HP, on the other hand, the notify codes represent the target brightness level on a 0..100 scale, so that consequtive presses of Fn+F3 yield an arithmetical progression of notify codes, e.g. 51,52,53 &c, which is why the simplest solution is to subsitute the notify value into the invocation of `backlight'. Translating those codes into exponential changes would require first of all to recall the previous value in order to determine whether the current event is an increase or a decrease. See what I mean?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20240705021810.f58cad5f961b7e5b7968e2db>