blob: ed86a5fef64a21b555746ec676ee5199a04e244a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/usr/bin/env bash
set -euo pipefail
export DISPLAY="${DISPLAY:-:0}"
if [ -z "${XAUTHORITY:-}" ] && [ -r "$HOME/.Xauthority" ]; then
export XAUTHORITY="$HOME/.Xauthority"
fi
if pgrep -u "$UID" -f 'polkit-gnome-authentication-agent-1|polkit-kde-authentication-agent-1|lxqt-policykit-agent|polkit-mate-authentication-agent-1|xfce-polkit' >/dev/null 2>&1; then
exit 0
fi
agents=(
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
/usr/lib/polkit-kde-authentication-agent-1
/usr/lib/lxqt-policykit/lxqt-policykit-agent
/usr/bin/lxqt-policykit-agent
/usr/lib/mate-polkit/polkit-mate-authentication-agent-1
/usr/lib/xfce-polkit/xfce-polkit
)
for agent in "${agents[@]}"; do
if [ -x "$agent" ]; then
exec "$agent"
fi
done
echo "No supported polkit authentication agent found" >&2
exit 1
|