From nobody Thu Jul 04 23:02:34 2024 X-Original-To: freebsd-stable@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 4WFXHK4KXNz5Q2nJ for ; Thu, 04 Jul 2024 23:02:53 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFXHJ2mp3z4f4V for ; Thu, 4 Jul 2024 23:02:52 +0000 (UTC) (envelope-from kob6558@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ud1DxJLh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of kob6558@gmail.com designates 2607:f8b0:4864:20::b33 as permitted sender) smtp.mailfrom=kob6558@gmail.com Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e03a63ec15eso991548276.1 for ; Thu, 04 Jul 2024 16:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720134171; x=1720738971; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=l4lrSNbXUmq7g2UBOwiE0u8qQMf1pdzm/ZCgnYeLlwQ=; b=Ud1DxJLhxxXonFlabLELD/TPHcrH+DCENe52EGvy8++5bLyiTRgKsDZt0lpT9WXEXz QVuCbAsB/LRzAzujkd43t6J44ek1ldJu0oa3WcMwDleXZQvEWgDMI2GlNgsEUloNZQtP lMgB1ZHy7U/J2hwGRuete/4VBFKxIS9hOPf0cVgZziFVhzcENJ/YNvNSBEHpne64Ph2J 5TCQyl8ajZBxwLDJVkZqj9Xwy0+cL6jwO/kk9sPHMr81YNl1D7MVW6CTccI2GVLBHaUx AakkfhR07wC75wYrGfG5zz85cL71sqEmDR0grenPu9V6XuNC7c0pHuMBtWFIg89k3uC6 R6AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720134171; x=1720738971; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l4lrSNbXUmq7g2UBOwiE0u8qQMf1pdzm/ZCgnYeLlwQ=; b=v7Ace2nyHeRh/x7k3GI6+DHKFUXPxPDjw46jN/jl0VaDWAOMgjxdPvWSqhavr4ndyF rasiK3CPWyybF5Rf2ahcPRJS6LZtqaq7TSc5sPXpkBTYP7LRYbZB7gUEUOGlqNOVUcZR vbpfXRZLTbotFtwk/q1iiwnUSy39VctDBbXn1FD7z6CvAKoe6lkTlJcttrclKjlg03gy G4wGiO4kwXdTBkK0GV7NstHuIgUDfRD27647BOePEyzouvxyNvtnv1fRWyt5PE+eIS75 6NPncqDORdKTL4eXvPQ5C7gC/V0md0E6AmD7ya4mPMnXF57ufvD6/wRpQln22Cr4Cof0 fu9g== X-Gm-Message-State: AOJu0YzRycVZ8FhGApAuHmcj0YAnAfzTM2eAuc42xl0Yd/L4NL1pLVEK WJMlhOuaY1WPuhkD/XeYWx3MEM1v6QN8HAuy5WoP4mLC/sTkQ5AdMuQDXgbHmJivyEGEhRLyNGN 551gYV6uNAsiMAnYUn+6h3JSMMTO9mFdOCo8= X-Google-Smtp-Source: AGHT+IEtRNkL4FTudjV8DS7z7cY3lPhuEHeLQz4krxnETZp34oRDnR7k20dzrgYZNOaV7MqFxO18lH9Iea0BvmwzCsc= X-Received: by 2002:a05:690c:4986:b0:62f:2589:1231 with SMTP id 00721157ae682-652d7d5292bmr35240667b3.42.1720134171229; Thu, 04 Jul 2024 16:02:51 -0700 (PDT) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-stable@freebsd.org Sender: owner-freebsd-stable@FreeBSD.org MIME-Version: 1.0 References: <20240704010029.75608a4e49205eb38a6034be@gmail.com> <20240705005834.4c7983ea29da3af8f8e36718@gmail.com> In-Reply-To: <20240705005834.4c7983ea29da3af8f8e36718@gmail.com> From: Kevin Oberman Date: Thu, 4 Jul 2024 16:02:34 -0700 Message-ID: Subject: Re: Need help controlling laptom display brightness via sysctl To: Anton Shepelev Cc: freebsd-stable@freebsd.org Content-Type: multipart/alternative; boundary="0000000000003e0549061c73f235" X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.67 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.968]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FORGED_SENDER(0.30)[rkoberman@gmail.com,kob6558@gmail.com]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b33:from]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rkoberman@gmail.com,kob6558@gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[freebsd-stable@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4WFXHJ2mp3z4f4V --0000000000003e0549061c73f235 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jul 4, 2024 at 2:59=E2=80=AFPM Anton Shepelev = wrote: > I wrote: > > > I need your help in setting up the brightness control on > > HP 15-b0xx laptop via sysctl. > > I was infored that this ability has been discountinued in > favour of the backlight utility, so I gave up and wrote the > following devd rule: > > notify 10 > { match "system" "ACPI" ; > match "subsystem" "Video" ; > match "type" "brightness" ; > action "/usr/bin/backlight $notify"; }; > > This changes brightness by tiny 1/100 steps, but this is > by desing of the HP engineers... > > References: > 1. https://man.freebsd.org/cgi/man.cgi?query=3Ddevd.conf > 2. > https://www.davidschlachter.com/misc/freebsd-acpi_video-thinkpad-display-= brightness > > This is what I used. I have it in /etc/devd/thinkpad.conf. You might use HP.conf: notify 100 { match "system" "ACPI"; match "subsystem" "ACAD"; match "notify" "0x00"; action "/usr/bin/backlight 40; service power_profile $notify"; }; notify 100 { match "system" "ACPI"; match "subsystem" "ACAD"; match "notify" "0x01"; action "/usr/bin/backlight 100; service power_profile $notify"; }; 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. --=20 Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 --0000000000003e0549061c73f235 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jul 4, 2024 at 2:59=E2= =80=AFPM Anton Shepelev <anton.tx= t@gmail.com> wrote:
I wrote:

> I need your help in setting up the brightness control on
> HP 15-b0xx laptop via sysctl.

I was infored that this ability has been discountinued in
favour of the backlight utility, so I gave up and wrote the
following devd rule:

notify 10
{=C2=A0 =C2=A0 =C2=A0 =C2=A0match=C2=A0 "system"=C2=A0 =C2=A0 &qu= ot;ACPI"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 match=C2=A0 "subsystem" "Video&q= uot;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 match=C2=A0 "type"=C2=A0 =C2=A0 =C2= =A0 "brightness"=C2=A0 =C2=A0 ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 action "/usr/bin/backlight $notify";= =C2=A0 };

This changes brightness by tiny 1/100 steps, but this is
by desing of the HP engineers...

References:
1. https://man.freebsd.org/cgi/man.cgi?query=3D= devd.conf
2. https://www.da= vidschlachter.com/misc/freebsd-acpi_video-thinkpad-display-brightness
This is what I used. I have it in /etc/dev= d/thinkpad.conf. You might use HP.conf:
notify 100 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match "system" =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"ACPI";
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0match "subsystem" =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "ACAD";
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0match "notify" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0"0x00";
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0action "/usr/bin/backlight 40; service power_profile $notify&qu= ot;;
=C2=A0};

notify 100 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m= atch "system" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0"ACPI";
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match &= quot;subsystem" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "= ;ACAD";
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match "notify" = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"0x01&qu= ot;;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0action "/usr/bin/backlight 1= 00; service power_profile $notify";
};

notify 100 {
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match "system" =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"ACPI";
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0match "subsystem" =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 "IBM";
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0match "notify" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0"0x10";
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0action "/usr/bin/backlight +";
};

notify 100 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match "system" =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"ACPI";
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0match "subsystem" =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "IBM";
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0match "notify" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0"0x11";
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0action "/usr/bin/backlight -";
};

10% changes are more reasonable than 1%. The top two &qu= ot;notify"s set the screen at 100% on AC and 40% on battery.
=
--
<= div>
Kevin Oberman, Part time kid her= der and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerp= rint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
--0000000000003e0549061c73f235--