This repository has been archived on 2025-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
inks-scripts/scripts/bash-status-bat
2022-06-08 17:22:25 +09:30

11 lines
264 B
Bash
Executable File

#!/bin/bash
current=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/%.*//' | sed 's/.*, //')
state=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/,.*//' | sed 's/.*: //')
if [[ "$state" == "Not charging" ]]; then
state="Full"
fi
echo "$current% $state"