From bc7538d0f1cf7a17a91b28b1fbf5b0ce1a0c6a05 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 2 Apr 2026 12:10:21 +0200 Subject: [PATCH] systemd: Update battery script --- systemd/usr/lib/systemd/system-sleep/battery | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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%) -- 2.39.5