Files
dots/config/polybar/scripts/stop_screensaver_status.sh
2025-11-24 19:46:30 +07:00

23 lines
464 B
Bash
Executable File

#!/usr/bin/env bash
STATEFILE="/tmp/stop-screensaver.state"
LABEL="stop-scr"
ICON_ON=""
ICON_OFF=""
if [ -f "$STATEFILE" ]; then
state=$(cat "$STATEFILE")
else
state=""
fi
# fallback проверка процесса, если statefile отсутствует/неактуален
if pgrep -f "/usr/local/bin/stop-screensaver.sh" >/dev/null; then
state="running"
fi
if [ "$state" = "running" ]; then
echo " $ICON_ON "
else
echo " $ICON_OFF "
fi