diff --git a/tool/ssinstall b/tool/ssinstall index 49f610f..c3794da 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -3,16 +3,11 @@ echo "Spark Store Install script.星火商店安装脚本" function pkexec_as_current_user() { - #Detect the name of the display in use - local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)" - - #Detect the user using such display - local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1) #Detect the id of the user local uid=$(id -u $user) - sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus pkexec "$@" + sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus pkexec "$@" } function zenity() {