From 453b42bc88e728441e5169536356d39b41d2b132 Mon Sep 17 00:00:00 2001 From: vermaden Date: Tue, 24 May 2022 12:52:32 +0200 Subject: [PATCH] Fix XORG detection. --- automount | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/automount b/automount index 384a6fa..1f22a38 100755 --- a/automount +++ b/automount @@ -167,7 +167,7 @@ then echo " / / // / // // / // \\\ \ \ \\\ \ \\\ \ \\\ \ \\\ \_ " echo " \_____\\\____/ \__\\\____//__________\\\__\__\__\\\____/ \_____\\\__\__\\\___\ " echo - echo "automount 1.7.8 2022/05/03" + echo "automount 1.7.9 2022/05/24" exit 0 fi @@ -713,11 +713,10 @@ case ${2} in for I in ${GROUP_USERS} do [ "${I}" = "root" ] && continue - DISPLAY_ID=$( procstat pargs $( pgrep Xorg ) | grep "^argv\[1\]:" | awk '{print $NF}' ) - if [ -z "${DISPLAY_ID}" ] - then - continue - fi + XORG_PID=$( pgrep Xorg ) + [ "${XORG_PID}" = "" ] && continue + DISPLAY_ID=$( procstat pargs ${XORG_PID} | grep "^argv\[1\]:" | awk '{print $NF}' ) + [ -z "${DISPLAY_ID}" ] && continue __log "${DEV}: starting '${FM}' file manager" su -l "${I}" -c "env DISPLAY=${DISPLAY_ID} ${FM} ${MNT} &" 1> /dev/null 2>&1 done