From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 5A82F213B9 for ; Tue, 16 Apr 2024 18:20:59 +0200 (CEST) Received: from gaff.inri.net ([168.235.71.243]) by 9front; Tue Apr 16 12:19:38 -0400 2024 Message-ID: <987137D97785518F2D32366C21388469@gaff.inri.net> Date: Tue, 16 Apr 2024 12:19:38 -0400 From: sl@stanleylieber.com To: 9front@9front.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: optimized injection enhancement CSS backend Subject: Re: [9front] Re: [9front] ThinkPad X380 Yoga, aux/acpi reports 13245% battery charge Reply-To: 9front@9front.org Precedence: bulk > In aux/acpi.c try replacing (batteryread func only) bats[n].fullcharge > with b->capacity. i did this: state = "charging"; if(st.rate > 0 && (st.state & 2) == 0) ss = st.capacity * 3600 / st.rate; - if(bats[n].fullcharge > 0){ - x = st.capacity * 100 / bats[n].fullcharge; + if(b->capacity > 0){ + x = st.capacity * 100 / b->capacity; if(st.rate > 0 && (st.state & 2) != 0) - ss = (bats[n].fullcharge - st.capacity) * 3600 / st.rate; + ss = (b->capacity - st.capacity) * 3600 / st.rate; } }else{ memset(&st, 0, sizeof(st)); and i get this: ; mk acpi.install 6l -o 6.acpi acpi.6 cp 6.acpi /amd64/bin/aux/acpi ; aux/acpi ; cat /dev/battery 82479 mW 197950 240 51000 12 1600 mV 0 15280 00:00:00 discharging sl