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

17 lines
372 B
Bash
Executable File

#!/usr/bin/env bash
SCRIPT="/usr/local/bin/stop-screensaver.sh"
STATEFILE="/tmp/stop-screensaver.state"
if pgrep -f "$SCRIPT" >/dev/null; then
pkill -f "$SCRIPT"
else
nohup "$SCRIPT" >/dev/null 2>&1 &
fi
# записать текущее состояние
if pgrep -f "$SCRIPT" >/dev/null; then
echo "running" >"$STATEFILE"
else
echo "stopped" >"$STATEFILE"
fi