From: Stefan Huber Date: Thu, 2 Apr 2026 10:10:21 +0000 (+0200) Subject: systemd: Update battery script X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=bc7538d0f1cf7a17a91b28b1fbf5b0ce1a0c6a05;p=shutils.git systemd: Update battery script --- diff --git a/systemd/usr/lib/systemd/system-sleep/battery b/systemd/usr/lib/systemd/system-sleep/battery index 778bbd6..a16fb1a 100755 --- a/systemd/usr/lib/systemd/system-sleep/battery +++ b/systemd/usr/lib/systemd/system-sleep/battery @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Stefan Huber, 2024-11-10 acpi=$(acpi) @@ -6,7 +6,7 @@ date=$(date -Iseconds --utc) addendum="." if [ "$1" = "post" ]; then - lastpre=$(grep pre /var/log/batterstat.log | tail -n1) + lastpre=$(grep "pre:" /var/log/batterstat.log | tail -n1) if [ ! -z "${lastpre}" ]; then prepercent=$(echo "${lastpre}" | grep -o "[0-9]*%" | cut -f1 -d%)