aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Polkit-NixOS.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/scripts/Polkit-NixOS.sh')
-rwxr-xr-xconfig/hypr/scripts/Polkit-NixOS.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/config/hypr/scripts/Polkit-NixOS.sh b/config/hypr/scripts/Polkit-NixOS.sh
index 925deab5..c1e6e0a2 100755
--- a/config/hypr/scripts/Polkit-NixOS.sh
+++ b/config/hypr/scripts/Polkit-NixOS.sh
@@ -1,6 +1,26 @@
#!/usr/bin/env bash
-# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ ##
-# For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it
+# ==================================================
+# KoolDots (2026)
+# Project URL: https://github.com/LinuxBeginnings
+# License: GNU GPLv3
+# SPDX-License-Identifier: GPL-3.0-or-later
+# ==================================================
+# For NixOS starting of polkit agents. Prefer xfce4-polkit, fallback to polkit-gnome.
+
+# Find all xfce4-polkit executables in the Nix store
+xfce_polkit_paths=$(find /nix/store -name 'xfce4-polkit' -type f 2>/dev/null)
+
+for xfce_polkit_path in $xfce_polkit_paths; do
+ # Extract the directory containing the executable
+ xfce_polkit_dir=$(dirname "$xfce_polkit_path")
+
+ # Check if the executable is valid and exists
+ if [ -x "$xfce_polkit_dir/xfce4-polkit" ]; then
+ # Start the xfce4-polkit Authentication Agent
+ "$xfce_polkit_dir/xfce4-polkit" &
+ exit 0
+ fi
+done
# Find all polkit-gnome executables in the Nix store
polkit_gnome_paths=$(find /nix/store -name 'polkit-gnome-authentication-agent-1' -type f 2>/dev/null)
@@ -18,4 +38,4 @@ for polkit_gnome_path in $polkit_gnome_paths; do
done
# If no valid executable is found, report an error
-echo "No valid Polkit-GNOME Authentication Agent executable found." \ No newline at end of file
+echo "No valid polkit authentication agent executable found."
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage