fix: only notify low baterry when on BAT0
This commit is contained in:
parent
edcfdc2078
commit
e8d6a02c00
@ -25,8 +25,8 @@ notify() { \
|
|||||||
fi
|
fi
|
||||||
[ 300 -gt $delta ] && return;
|
[ 300 -gt $delta ] && return;
|
||||||
echo $now > $XDG_CONFIG_HOME/batteryupdate
|
echo $now > $XDG_CONFIG_HOME/batteryupdate
|
||||||
case "$total" in
|
case "$capacity" in
|
||||||
[2-3][0-9]) notify-send -u "normal" "Battery is running low ($capacity%)" "Please plug your computer to a power source" ;;
|
2[0-9]) notify-send -u "normal" "Battery is running low ($capacity%)" "Please plug your computer to a power source" ;;
|
||||||
*) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - <b>NOW!</b>" ;;
|
*) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - <b>NOW!</b>" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ do
|
|||||||
[2-3][0-9]) status="" ;;
|
[2-3][0-9]) status="" ;;
|
||||||
*) status="" ;;
|
*) status="" ;;
|
||||||
esac
|
esac
|
||||||
[ 40 -gt $total ] && notify;
|
[ "BAT0" = $slot ] && [ 30 -gt $capacity ] && notify;
|
||||||
fi
|
fi
|
||||||
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user