#!/bin/bash

BATTERY=$(upower -e | grep 'BAT')

while [ 1 ]
do
    BATTERY_PERCENTAGE=$(upower -i $BATTERY|grep percentage|awk '{ print $2 
}'|sed s/'%'/''/g)

    if [[ "$BATTERY_PERCENTAGE" -lt "11" ]]; then

    notify-send --urgency=critical "WARNING: Battery is about to die"  "Plug in 
the power cable"
    play /usr/share/sounds/KDE-Sys-Warning.ogg &> /dev/null 
    fi

sleep 10

done

** Attachment added: "It will give notification when the battery is low and you 
should run this .sh file in terminal."
   
https://bugs.launchpad.net/ubuntu/+source/notify-osd/+bug/617816/+attachment/4521746/+files/BatteryAlert.sh

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/617816

Title:
  Critically Low Battery Notification not showing in Ubuntu 14.04 lts

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/notify-osd/+bug/617816/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to