/ de-omarchy / bin / omarchy-sudo-keepalive
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
10 lines · 268 Bytes
1
2
3
4
5
6
7
8
9
10
#!/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