From e573952843e97c4460eb7376c2c5036c99e9c21f Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Sat, 24 Jul 2010 02:14:15 +0000 Subject: Allow ConsoleKit to mark X sessions started with startx as active. This will fix a lot of problems with delays starting GNOME applications, permission problems mounting removable media, and problems not being able to shutdown or reboot. Reported by: many --- sysutils/consolekit/files/ck-get-x11-display-device | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sysutils/consolekit/files/ck-get-x11-display-device') diff --git a/sysutils/consolekit/files/ck-get-x11-display-device b/sysutils/consolekit/files/ck-get-x11-display-device index 6fc508360b92..7efc08471660 100644 --- a/sysutils/consolekit/files/ck-get-x11-display-device +++ b/sysutils/consolekit/files/ck-get-x11-display-device @@ -5,7 +5,6 @@ GREP="/usr/bin/grep" AWK="/usr/bin/awk" SED="/usr/bin/sed" CAT="/bin/cat" -HEAD="/usr/bin/head" dispnum=0 if [ x"$1" = x"--display" ]; then @@ -25,11 +24,18 @@ if [ ! -f "/tmp/.X${dispnum}-lock" ]; then fi pid=$(${CAT} "/tmp/.X${dispnum}-lock") -device=$(${FSTAT} -p ${pid} | ${GREP} ttyv | ${HEAD} -1 | ${AWK} '{print $8}') +device=$(${FSTAT} -p ${pid} | ${GREP} ttyv | ${AWK} '{print $8}') if [ -z "${device}" ]; then echo "ERROR: Failed to find TTY device for X server on display ${dispnum}" exit 1 fi -echo "/dev/${device}" +ret="" +for dev in ${device}; do + if [ "${dev}" \> "${ret}" ]; then + ret=${dev} + fi +done + +echo "/dev/${dev}" -- cgit v1.2.3