linuxOS_AP05/debian/test/usr/bin/synaptic-pkexec
2025-09-26 09:40:02 +08:00

20 lines
568 B
Bash
Executable File

#!/bin/sh
USING_WAYLAND=0
if [ ! "x${WAYLAND_DISPLAY}" = "x" ]; then
USING_WAYLAND=1
fi
if [ "x${XDG_SESSION_TYPE}" = "xwayland" ]; then
USING_WAYLAND=1
fi
if [ "x${USING_WAYLAND}" = "x1" ]; then
# Running wayland; start synaptic without pkexec
zenity --warning --width=500 --text \
"You are using Wayland environment, Synaptic will continue without administrative privileges.\\n\
To make Synaptic fully functional, please restart your session without Wayland."
exec "/usr/sbin/synaptic" "$@"
else
pkexec "/usr/sbin/synaptic" "$@"
fi