Several fixes, patched dwmblocks so it shows spaces around the bar

This commit is contained in:
2025-09-30 13:42:23 +02:00
parent a250278454
commit 3f399b5c0e
10 changed files with 90 additions and 22 deletions

View File

@@ -1,7 +1,13 @@
#!/bin/bash
#!/usr/bin/env bash
prct=$(acpi | grep 'Discharging' | awk '{print $4}' | sed 's/,//')
batid=$(acpi | grep 'Discharging' | awk '{print $2}' | sed 's/://')
prct=$(acpi 2>/dev/null | grep 'Discharging' | awk '{print $4}' | sed 's/,//')
batid=$(acpi 2>/dev/null | grep 'Discharging' | awk '{print $2}' | sed 's/://')
# If not supported
if [[ $(acpi 2>&1 | grep 'No support') ]]; then
echo "No battery" >&2;
exit 1
fi
# If charged
if [[ $(acpi | grep 'Discharging' | wc -c) -eq $(acpi | grep 'Charging' | wc -c) ]]; then