irongit
hygoland/scripts/Polkit.sh
34 lines1.1 KBBourne Again Shell (bash)
1#!/bin/bash
2# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
3# This is for polkits, it will start from top and will stop if the top is executed
4
5# Polkit possible paths files to check
6polkit=(
7 "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
8 "/usr/libexec/hyprpolkitagent"
9 "/usr/lib/hyprpolkitagent"
10 "/usr/lib/hyprpolkitagent/hyprpolkitagent"
11 "/usr/lib/polkit-kde-authentication-agent-1"
12 "/usr/lib/polkit-gnome-authentication-agent-1"
13 "/usr/libexec/polkit-gnome-authentication-agent-1"
14 "/usr/libexec/polkit-mate-authentication-agent-1"
15 "/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1"
16 "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
17)
18
19executed=false # Flag to track if a file has been executed
20
21# Loop through the list of files
22for file in "${polkit[@]}"; do
23 if [ -e "$file" ]; then
24 echo "File $file found, executing command..."
25 exec "$file"
26 executed=true
27 break
28 fi
29done
30
31# If none of the files were found, you can add a fallback command here
32if [ "$executed" == false ]; then
33 echo "None of the specified files were found. Install a Polkit"
34fi