From 28628fbb9392496f4b25fda887a2318641f39b38 Mon Sep 17 00:00:00 2001 From: eshanized Date: Sat, 11 Jan 2025 18:36:40 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20perf:=20improve=20with=20c?= =?UTF-8?q?ommand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snigdhaos-calamares/calamares_polkit | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/snigdhaos-calamares/calamares_polkit b/snigdhaos-calamares/calamares_polkit index 6089e64a..2e007e61 100755 --- a/snigdhaos-calamares/calamares_polkit +++ b/snigdhaos-calamares/calamares_polkit @@ -1,6 +1,10 @@ #!/bin/bash -if [ $(which pkexec) ]; then - pkexec --disable-internal-agent "/usr/bin/calamares" "$@" + +# Check if pkexec exists and is executable +if command -v pkexec &>/dev/null; then + # Use pkexec to run calamares with administrative privileges + pkexec --disable-internal-agent /usr/bin/calamares "$@" else - /usr/bin/calamares "$@" -fi \ No newline at end of file + # Fallback to running calamares without administrative privileges + /usr/bin/calamares "$@" +fi