mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Use sudo keepalive to ensure that we don't get a sudo timeout on a long-running install
This commit is contained in:
@@ -20,7 +20,8 @@ pkg_names=$(yay -Slqa | fzf "${fzf_args[@]}")
|
||||
|
||||
if [[ -n $pkg_names ]]; then
|
||||
# Add aur/ prefix to each package name and convert to space-separated for yay
|
||||
sudo -v
|
||||
source omarchy-sudo-keepalive
|
||||
|
||||
echo "$pkg_names" | sed 's/^/aur\//' | tr '\n' ' ' | xargs yay -S --noconfirm
|
||||
sudo updatedb
|
||||
omarchy-show-done
|
||||
|
||||
@@ -17,7 +17,9 @@ fzf_args=(
|
||||
pkg_names=$(pacman -Slq | fzf "${fzf_args[@]}")
|
||||
|
||||
if [[ -n $pkg_names ]]; then
|
||||
# Convert newline-separated selections to space-separated for yay
|
||||
source omarchy-sudo-keepalive
|
||||
|
||||
# Convert newline-separated selections to space-separated for pacman
|
||||
echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm
|
||||
omarchy-show-done
|
||||
fi
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Prompt for sudo once and keep the credential alive in the background.
|
||||
# Source this script so the trap applies to the calling shell:
|
||||
# source omarchy-sudo-keepalive
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user