mirror of
https://github.com/Snigdha-OS/snigdhaos-pkgbuilds.git
synced 2025-09-21 20:14:59 +02:00
@eshanized: push via script
This commit is contained in:
14
common/snigdhaos-libs/pexec-gui
Normal file
14
common/snigdhaos-libs/pexec-gui
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ $EUID -ne 0 ]; then
|
||||||
|
exec pkexec /usr/lib/snigdhaos/pkexec-gui "$@"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Need some previous vars
|
||||||
|
while IFS= read -rd '' var; do export "$var"; done < <(grep --null-data -ae "^\($XDG_CURRENT_DESKTOP\|WAYLAND_DISPLAY\|XDG_RUNTIME_DIR\|XDG_SESSION_TYPE\|XCURSOR_SIZE\|LC_*\|LANG\|LANGUAGE\|QT_WAYLAND_FORCE_DPI\|QT_QPA_PLATFORMTHEME\|QT_STYLE-OVERRIDE\|\)=.*\$" /proc/$PPID/environ)
|
||||||
|
if [[ -v WAYLAND_DISPLAY ]]; then
|
||||||
|
export WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
|
||||||
|
fi
|
||||||
|
export XDG_RUNTIME_DIR="/run/user/0"
|
||||||
|
exec "$@"
|
Reference in New Issue
Block a user