localname=$(hostname)
elif check_com hostnamectl ; then
localname=$(hostnamectl --static)
+ else
+ localname="$(uname -n)"
fi
hosts=(
function batterydarwin () {
GRML_BATTERY_LEVEL=''
local -a table
-table=( ${$(pmset -g ps)[(w)7,8]%%(\%|);} )
+table=( ${$(pmset -g ps)[(w)8,9]%%(\%|);} )
if [[ -n $table[2] ]] ; then
case $table[2] in
charging)
localname=$(hostname)
elif check_com hostnamectl ; then
localname=$(hostnamectl --static)
+ else
+ localname="$(uname -n)"
fi
# set hostname if not running on local machine