#!/usr/bin/env bash
plugged=0

swaybg -i images/wallpaper/wallpaper-cultured &

while true; do
	STATE=$(cat /sys/class/power_supply/BATT/status)
    if [[ "$STATE" = "Charging" ]]; then 
        if [ "$plugged" -eq "0" ]; then 
            plugged=1
            notify-send 'Aghh~~~~'
            play scripts/supersecretsettings/culture.mp3
        fi
    else 
        plugged=0
    fi      
	sleep 1
done