Added Dbus

This commit is contained in:
Roy 2024-02-28 21:13:41 -08:00 committed by GitHub
parent f17923904d
commit 7db92bcb4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,11 @@ set -o pipefail # capture error from pipes
# $USER # $USER
[[ -n $(logname >/dev/null 2>&1) ]] && logged_in_user=$(logname) || logged_in_user=$(whoami) [[ -n $(logname >/dev/null 2>&1) ]] && logged_in_user=$(logname) || logged_in_user=$(whoami)
#DBUS
# Add the DBUS_SESSION_BUS_ADDRESS environment variable
dbus_address=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ | cut -d= -f2-)
export DBUS_SESSION_BUS_ADDRESS=$dbus_address
# $UID # $UID
# logged_in_uid=$(id -u "${logged_in_user}") # logged_in_uid=$(id -u "${logged_in_user}")