mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-29 15:12:21 +08:00
update tool/ssinstall.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
This commit is contained in:
parent
8d41966d67
commit
72ba481180
@ -3,16 +3,11 @@
|
|||||||
echo "Spark Store Install script.星火商店安装脚本"
|
echo "Spark Store Install script.星火商店安装脚本"
|
||||||
|
|
||||||
function pkexec_as_current_user() {
|
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
|
#Detect the id of the user
|
||||||
local uid=$(id -u $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() {
|
function zenity() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user