aboutsummaryrefslogtreecommitdiffstats
path: root/bin/setup_screens
diff options
context:
space:
mode:
Diffstat (limited to 'bin/setup_screens')
-rwxr-xr-xbin/setup_screens9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/setup_screens b/bin/setup_screens
index 1cdd143..995dab6 100755
--- a/bin/setup_screens
+++ b/bin/setup_screens
@@ -145,9 +145,15 @@ if [ "$#" -eq 1 ]; then
action="$1"
fi
+logger "Calling 'setup_screens'"
get_x_user
get_current_user
get_path
+
+# Export Xorg DISPLAY and XAUTHORITY
+export DISPLAY=$(ls /tmp/.X*|grep "lock"|cut -d '.' -f2| cut -d '-' -f1|sed -e 's/X/:/')
+export XAUTHORITY="$(eval echo ~$x_user/.Xauthority)"
+
# if the script caller is the current X user or root (and lightdm is the current X user)
if [ "$current_user" = "$x_user" ] || [ $current_user = "root" -a $x_user = "lightdm" ]; then
get_lid_state
@@ -156,7 +162,8 @@ if [ "$current_user" = "$x_user" ] || [ $current_user = "root" -a $x_user = "lig
set_configuration
else
if [ $current_user = "root" ]; then
- runuser -l "$x_user" -c '$path'
+ logger "Running $path as user $x_user now."
+ runuser -l $x_user -c $path
else
echo "$current_user is not currently running X and is not allowed to let the current X user run this script."
exit 1