Supressed error message for invalid acpi date (happens when disconnecting the power cable)

pull/22/head
Dean Fenster 8 years ago
parent a637321d58
commit b37090073c

@ -412,7 +412,7 @@ prompt_battery() {
if [[ $time_remaining =~ rate ]]; then if [[ $time_remaining =~ rate ]]; then
local tstring="..." local tstring="..."
elif [[ $time_remaining =~ "[:digit:]+" ]]; then elif [[ $time_remaining =~ "[:digit:]+" ]]; then
local tstring=${(f)$(date -u -d "$(echo $time_remaining)" +%k:%M)} local tstring=${(f)$(date -u -d "$(echo $time_remaining)" +%k:%M 2> /dev/null)}
fi fi
fi fi
[[ -n $tstring ]] && local remain=" ($tstring)" [[ -n $tstring ]] && local remain=" ($tstring)"

Loading…
Cancel
Save