Files
arthur-os/bin/omarchy-sudo-keepalive
T
2026-04-28 12:03:46 -04:00

10 lines
268 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Prompt for sudo once and keep the credential alive in the background.
# omarchy:requires-sudo=true
sudo -v
while true; do sudo -n true; sleep 60; done 2>/dev/null &
SUDO_KEEPALIVE_PID=$!
trap "kill $SUDO_KEEPALIVE_PID 2>/dev/null" EXIT