Several fixes, patched dwmblocks so it shows spaces around the bar
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user