#!/bin/bash while (true); do percentage=acpi | awk '{split($4,a,"%"); print a[1]}' if [ $percentage > 6 ]; then swaynag -m "Battery is almost empty" -e bottom break fi sleep 30 done