diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-03-30 21:58:55 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-03-30 21:58:55 -0700 |
| commit | 4acf85db722ebe7e019e7427436083b3b9f4959e (patch) | |
| tree | 6d5b416ad605730a6d573d1b4178c7676dc8a015 /config/hypr/scripts/Polkit.sh | |
| parent | 89e10cd0c0331fc727889d41e34309db1fb5735f (diff) | |
| parent | e4b9059d346e6a6dbd6216cd1fb5e41085bb6e7b (diff) | |
Merge remote-tracking branch 'upstream/main'
Diffstat (limited to 'config/hypr/scripts/Polkit.sh')
| -rwxr-xr-x | config/hypr/scripts/Polkit.sh | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/config/hypr/scripts/Polkit.sh b/config/hypr/scripts/Polkit.sh index 9db94d89..768747ab 100755 --- a/config/hypr/scripts/Polkit.sh +++ b/config/hypr/scripts/Polkit.sh @@ -1,19 +1,47 @@ #!/usr/bin/env bash -# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This script starts the first available Polkit agent from a list of possible locations +# Avoid duplicate agents (common with UWSM/session autostart) +if pgrep -u "$UID" -f 'xfce-polkit|polkit-gnome-authentication-agent-1|polkit-kde-authentication-agent-1|polkit-mate-authentication-agent-1|mate-polkit|hyprpolkitagent' >/dev/null 2>&1; then + echo "Polkit agent already running. Skipping start." + exit 0 +fi + +# Ensure Qt apps default to Wayland in a Wayland session +if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -z "${QT_QPA_PLATFORM:-}" ]; then + export QT_QPA_PLATFORM=wayland +fi -# List of potential Polkit agent file paths +# Avoid KDE polkit agent crashing if Kvantum QML module is missing +if [ -z "${QT_QUICK_CONTROLS_STYLE:-}" ]; then + export QT_QUICK_CONTROLS_STYLE=Basic +fi +if [ -z "${QT_STYLE_OVERRIDE:-}" ]; then + export QT_STYLE_OVERRIDE=Fusion +fi + +# List of potential Polkit agent file paths (preferred order) polkit=( + "/usr/bin/xfce-polkit" + "/usr/lib/xfce4/polkit-agent/xfce-polkit" + "/usr/libexec/xfce-polkit" "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" - "/usr/libexec/hyprpolkitagent" - "/usr/lib/hyprpolkitagent" - "/usr/lib/hyprpolkitagent/hyprpolkitagent" - "/usr/lib/polkit-kde-authentication-agent-1" "/usr/lib/polkit-gnome-authentication-agent-1" "/usr/libexec/polkit-gnome-authentication-agent-1" "/usr/libexec/polkit-mate-authentication-agent-1" - "/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1" + "/usr/lib/polkit-mate/polkit-mate-authentication-agent-1" + "/usr/bin/polkit-mate-authentication-agent-1" "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" + "/usr/lib/polkit-kde-authentication-agent-1" + "/usr/libexec/polkit-kde-authentication-agent-1" + "/usr/libexec/hyprpolkitagent" + "/usr/lib/hyprpolkitagent" + "/usr/lib/hyprpolkitagent/hyprpolkitagent" ) executed=false |
