From nobody Fri Aug 16 23:47:00 2024 X-Original-To: freebsd-acpi@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlzDY4p4Yz5TmlB for ; Fri, 16 Aug 2024 23:47:09 +0000 (UTC) (envelope-from lumiwa@dismail.de) Received: from mx2.dismail.de (mx2.dismail.de [159.69.191.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlzDY1cZmz4QRk for ; Fri, 16 Aug 2024 23:47:09 +0000 (UTC) (envelope-from lumiwa@dismail.de) Authentication-Results: mx1.freebsd.org; none Received: from mx2.dismail.de (localhost [127.0.0.1]) by mx2.dismail.de (OpenSMTPD) with ESMTP id 1a0d7761; Sat, 17 Aug 2024 01:47:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=20190914; bh=txeLOvun syHvSmbew1Ck+NWROW3nzS7meLt8+Cwm8do=; b=BpHKQ81c+tc/wdxezevqSI+Q u39zUBDwXBeaGO0JQfux19WBgVbQLX8eOFR3bWcbp6CXejCo2DRKi0BC2jqqn13M 3PP7InswYDdMGOpi8BRxH+sAKXT2YvayIWV500Sd/K9I5E605XPCq1IoVE8U8dEj HM40vjAR/ZQjMAvAbGbidHMcMpH+VBUBy2ZskSNqfBgyH3FXFwmwi4oQCc0MhYIR wMuIOGnDMZ8pL/qVWCiT6A+S+xlAyWvLJ3TiXQAlUs8eQziIA6cVRSInKh+98J42 VPDLx4PUeLHZD5nSqYpLy1+zrovQFYh3zDntmR4GpIZF/zG4tjfiGWH/VdQj7w== Received: from smtp1.dismail.de ( [10.240.26.11]) by mx2.dismail.de (OpenSMTPD) with ESMTP id 9e16bacb; Sat, 17 Aug 2024 01:47:05 +0200 (CEST) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id d6fe7ab0; Sat, 17 Aug 2024 01:47:05 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id e40f9814 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 17 Aug 2024 01:47:04 +0200 (CEST) Date: Fri, 16 Aug 2024 19:47:00 -0400 From: LuMiWa To: "Marc Coquand" Cc: Subject: Re: acpi_ibm brightness man page example not working + fix Message-ID: <20240816194700.190b46bb@dismail.de> In-Reply-To: References: X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: ACPI and power management development List-Archive: https://lists.freebsd.org/archives/freebsd-acpi List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-acpi@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:159.69.0.0/16, country:DE] X-Rspamd-Queue-Id: 4WlzDY1cZmz4QRk On Fri, 16 Aug 2024 17:53:38 -0500 "Marc Coquand" wrote: > Hi! >=20 > Apologize in advance if I'm reporting this wrong, this is my first > post to the mailing list and my first time contributing to Freebsd. :) >=20 > I noticed that the example in the manpage for acpi_ibm, specifically > for setting up brightness was not working for me. The specific part > that did not work for me is: >=20 > + 0x10|0x11) > + LEVEL=3D`sysctl -n dev.acpi_${OEM}.0.lcd_brightness` > + PERCENT=3D`${ECHO} "${BC_PRECOMMANDS} ; \ > + ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\ > + ${CALC} | ${CUT} -d . -f 1` > + MESSAGE=3D"brightness level ${PERCENT}%" > + ;; > + >=20 > This was tested on my Thinkpad T480s. It makes sense that it would not > work, because manually changing the brightness with `sysctl > dev.acpi_ibm.0.lcd_brightness=3DXXX` did not do anything either on my > laptop. >=20 > Since FreeBSD 13.0, there is a new backlight utility, and with that I > was able to fix backlight on my computer by simply creating the > following devd config: >=20 > /etc/devd/acpi_ibm_brightness.conf > + notify 20 { > + match "system" "ACPI"; > + match "subsystem" "IBM"; > + match "notify" "0x10"; > + action "/usr/bin/backlight incr 10"; > + }; > + > + notify 20 { > + match "system" "ACPI"; > + match "subsystem" "IBM"; > + match "notify" "0x11"; > + action "/usr/bin/backlight decr 10"; > + }; >=20 > Maybe the examples in acpi_ibm manpages should use backlight utility > instead? >=20 > Alternatively, maybe the devd rules above could be added by default so > that backlight works out of the box if you load acpi_ibm? It'd be easy > to also add support for volume control with mixer. I am happy to make > a patch if this is of interest. >=20 > Sincerely, > Marc >=20 Thank you very much for acpi_ibm_brightness.conf :). It works on my T495 too. --=20 =E2=80=9CI hate books; they only teach us to talk about things we know noth= ing about.=E2=80=9D =E2=80=95 Jean-Jacques Rousseau=20