Refactoring repository...
Some checks are pending
Check Conventional Commit / check-commit-message (push) Waiting to run

This commit is contained in:
CELESTIFYX
2025-01-14 19:02:06 +02:00
parent 876fa0988e
commit 08abac9e7d
33171 changed files with 4677 additions and 761 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
# Determine whether to use GUI authentication based on environment and variable
SNIGDHAOSLIB_GUI="${SNIGDHAOSLIB_GUI:-true}"
# If running in a non-graphical environment, disable GUI authentication
if [ -z "$DISPLAY" ]; then
SNIGDHAOSLIB_GUI=false
fi
# Check if we need to run with elevated privileges and handle accordingly
if [[ $EUID -ne 0 ]] && [ "$SNIGDHAOSLIB_GUI" == "true" ]; then
# Use pkexec to elevate with GUI if necessary
exec pkexec /usr/lib/snigdhaos/install-package "$@";
exit 1
fi
# Use sudo for elevation if we are not using pkexec
if [[ $EUID -ne 0 ]]; then
sudo pacman -S --noconfirm "$@"
else
# If we're already root, simply run pacman
pacman -S --noconfirm "$@"
fi