#!/bin/sh # those variables may be unnecessary export DISPLAY=:0 export HOME=/home/filipek percentage=$(upower -i "$(upower -e | grep BAT)" | awk '/percentage/ {gsub(/%/, "", $2); print $2}') if [ "$percentage" -le 5 ]; then notify-send "Battery very low." elif [ "$percentage" -ge 14 ] && [ "$percentage" -le 15 ]; then notify-send "Battery low." fi