diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-06-06 11:40:18 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-06 11:40:18 +0900 |
| commit | 1258a04a46d27cc1bc48fc57b4a68e1169fd7399 (patch) | |
| tree | ff89fe5203f0d86d891aefc0abf5b36577b80ffa | |
| parent | d6568b7f1b6c05abbb493af39fb12c243484da53 (diff) | |
Update Polkit.sh
ensuring a file
| -rwxr-xr-x | config/hypr/scripts/Polkit.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/config/hypr/scripts/Polkit.sh b/config/hypr/scripts/Polkit.sh index d009ecc8..dcea7653 100755 --- a/config/hypr/scripts/Polkit.sh +++ b/config/hypr/scripts/Polkit.sh @@ -1,8 +1,8 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# This is for polkits, it will start from top and will stop if the top is executed +# This script starts the first available Polkit agent from a list of possible locations -# Polkit possible paths files to check +# List of potential Polkit agent file paths polkit=( "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" "/usr/libexec/hyprpolkitagent" @@ -16,19 +16,19 @@ polkit=( "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" ) -executed=false # Flag to track if a file has been executed +executed=false -# Loop through the list of files +# Loop through the list of paths for file in "${polkit[@]}"; do - if [ -e "$file" ]; then - echo "File $file found, executing command..." - exec "$file" + if [ -e "$file" ] && [ ! -d "$file" ]; then + echo "Found: $file — executing..." + exec "$file" executed=true break fi done -# If none of the files were found, you can add a fallback command here +# Fallback message if nothing executed if [ "$executed" == false ]; then - echo "None of the specified files were found. Install a Polkit" + echo "No valid Polkit agent found. Please install one." fi |
