From 80bb363b80bb85b8f2a2d2a197e8786108bca16d Mon Sep 17 00:00:00 2001 From: flepied Date: Wed, 18 Aug 2004 02:56:02 +0000 Subject: put session file in /tmp/dbus-$USER-xsession$CURR_DISPLAY git-svn-id: svn+ssh://svn.mandriva.com/svn/soft/s2u/trunk@179788 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94 --- hostname-post | 2 +- s2u.sh | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hostname-post b/hostname-post index b8a3a86..5c432e6 100755 --- a/hostname-post +++ b/hostname-post @@ -10,7 +10,7 @@ # running X11 dbus session. #--------------------------------------------------------------- -for f in `ls /var/tmp/dbus-xsession* 2> /dev/null`; do +for f in `ls /tmp/dbus-*-xsession* 2> /dev/null`; do . $f dbus-send --type=method_call --dest=com.mandrakesoft.user.message /com/mandrakesoft/user com.mandrakesoft.user.message string:"Hostname: $1" & done diff --git a/s2u.sh b/s2u.sh index 098aa2e..cf2b1c6 100755 --- a/s2u.sh +++ b/s2u.sh @@ -1,34 +1,37 @@ #!/bin/sh #--------------------------------------------------------------- # Project : Mandrakelinux -# Module : alert_applet-0.13 +# Module : s2u # File : s2u.sh # Version : $Id$ # Author : Frederic Lepied # Created On : Sat Jul 31 01:03:37 2004 -# Purpose : +# Purpose : launch the dbus client attaching it to an +# exisiting dbus session or launching a new one to +# attache itself to. #--------------------------------------------------------------- +f="/tmp/dbus-$USER-xsession$CURR_DISPLAY" + vars() { CURR_DISPLAY=`LC_ALL=C xdpyinfo | grep 'display' | awk '{print $4}'` - if [ -f "/var/tmp/dbus-xsession$CURR_DISPLAY" -a -O "/var/tmp/dbus-xsession$CURR_DISPLAY" ]; then - . "/var/tmp/dbus-xsession$CURR_DISPLAY" + if [ -f "$f" -a -O "$f" ]; then + . "$f" fi } vars if [ -z "$DBUS_SESSION_BUS_PID" -o ! -d "/proc/$DBUS_SESSION_BUS_PID" ]; then - F=`mktemp /var/tmp/dbus.XXXXXX` + F=`mktemp /tmp/dbus.XXXXXX` chmod 600 $F dbus-launch --sh-syntax --exit-with-session > $F - rm -f "/var/tmp/dbus-xsession$CURR_DISPLAY" - mv -f $F "/var/tmp/dbus-xsession$CURR_DISPLAY" + rm -f "$f" + mv -f $F "$f" vars fi -s2u --daemon=yes - +exec s2u --daemon=yes # s2u.sh ends here -- cgit v1.2.1