From nobody Thu Jul 04 22:59:44 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 4WFXCp29qdz5Q2l2 for ; Thu, 04 Jul 2024 22:59:50 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFXCp1gmCz4cP2; Thu, 4 Jul 2024 22:59:50 +0000 (UTC) (envelope-from christos@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720133990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lBkVjym1aIVED9YPyzXLFs44oh1nAkr5gIxKbK2GmIE=; b=ieovMLCODX/0U1SKyMVKWNsk6ZxPtbrh0H+4doNyHYrnHneL1Uz5wluPcDU1/RMctA2C7G ntTM3d5M4eArdxUAP9Mh/m1oHUp8F+U8dJYjuUyCryrsW0LKkwKv+Nx8w/WuMDNg24eqKT 256GVyIywo0EesMMqYcUDjxcpHogkE/9gedWU9+bVzDnl91Bjiu/k1fH8pIkVhNp6X7hAm wxwNsrKGj1XJzsaLwhpkg1Art1j7e6sFiX15GZStLv38AVd8S3ZYd5ha3DNGy0igoByu7A 6PkN/PIv2BTKS5IMkKiXrdDkcMHrQvv8DheIJ+WuRZeY92xPnQ7y8dlcGvGRVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720133990; a=rsa-sha256; cv=none; b=PoHrOkzhu4lr0I7uAwxE6PPuYdd6SktyXgelanVRfkJsnYRcafzO8Ef26BNN1raa/A5g0G VTyRc4glkix3iVPyP9y8F+MgTp9rBA7OJ08q7wGxoWsqhu8WI8yEWcIU1VvdHVPXDSqc+Q LtDbTRAwVizwB6OAYQzZc5sC18sq1vpMIHoOK0VSVOduMKENqkE21vGM9VvapI6dI2BcRE 6Now/KiYw4Z5gAtbJGjX2iLiqu0Tn4d2oNKRsrCwOVVnOM+oda9tgk/LDsRGSYWoQSGZdc zFAWxrh/W9tRzvjXJLi79eXPTqQKFmXp9OzfMVT6qmu8jii3y5+6OYSFYBTaMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720133990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lBkVjym1aIVED9YPyzXLFs44oh1nAkr5gIxKbK2GmIE=; b=TxTXloFtcYmFwMYRiYQPz6DZkD3GpwkZqZcEwGcFrfdoo9wtr0tl41Gmbkq64Dd+KoH/M/ MeTjDwXyzW8vHc9ACQISJGDmZfjk0U3Q3hzf7a+w3pdqx17k+GsSzjKOldD0YAGdKUf7s+ uns8nlCEd5snbsCNeh8KrpiTYhl98LJ01DLLmg7IfTLXEs1Plpwl7++PNZwrtt8xBsYNVQ ZoXxD6Dj3ir0JBGtpcU5NNW47j2TQz+sQDzESTvgYn3oJQP7AOfu+WyGz0rJMBHXSjGyfU I8R3To5B1V1RrLciIenmQHpjweJzDABgsOb++Fcmu6MXyQ2I2wVmnBHenTk9Hw== Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (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) (Authenticated sender: christos/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WFXCn62dMz12q1; Thu, 4 Jul 2024 22:59:49 +0000 (UTC) (envelope-from christos@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=mail; bh=P6KfnJUcJEY3603 NM0ZbS7yCKBd1roBBUWvw7rHarqE=; h=in-reply-to:references:subject:cc:to: from:date; d=margiolis.net; b=D0XXTm+b+pWuvIAL+AibMNEqNeXjq6y9ba8v+7ak z+naSkNQ94KkIWIZ+CLwzL/lBmI7v46IUrgrX5+YigN2btv1D97IeUbjO/8Wj0VGshdUA0 tVFEVREGQe3Ic96FaCsd6BN2IBmNCOt+9JS7LVop3npq2p8Y75R7bFVEIQWtY= Received: from tpad (ip-45-81-121-44.ask4internet.com [45.81.121.44]) by margiolis.net (OpenSMTPD) with ESMTPSA id 49d47266 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 4 Jul 2024 22:59:45 +0000 (UTC) Date: Fri, 5 Jul 2024 00:59:44 +0200 From: Christos Margiolis To: Anton Shepelev Cc: freebsd-stable@freebsd.org Subject: Re: Need help controlling laptom display brightness via sysctl Message-ID: <4gdo43zawpgltmnc5antaa427pww6vehrvhueg7ib3w6o3surc@o3nradlaanma> References: <20240704010029.75608a4e49205eb38a6034be@gmail.com> <20240705005834.4c7983ea29da3af8f8e36718@gmail.com> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240705005834.4c7983ea29da3af8f8e36718@gmail.com> Hello Anton, 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: > > [...] In case you find this helpful, I wrote this very simple wrapper script today: #!/bin/sh bright=$(backlight -q -f /dev/backlight/backlight0) test $# -eq 0 && echo ${bright} && exit test ${bright} -le 10 -a "$(echo ${1} | grep "^[+|-]")" == "-" && exit backlight -f /dev/backlight/backlight0 "${1}" Then I modified my DWM config to bind Mod+F5 to "bind -" (decrease by 10%) and Mod+F6 to "bind +" (increase by 10%). The script also makes sure that if we want to decrease the brightness, we do not go below 10. If no arguments are passed it prints out the current brightness level. Christos