From 72ba481180af540b3b80a4e5bc116c9f8c16c3cf Mon Sep 17 00:00:00 2001 From: shenmo Date: Thu, 26 Jan 2023 17:05:35 +0000 Subject: [PATCH] update tool/ssinstall. Signed-off-by: shenmo --- tool/ssinstall | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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() {