diff options
-rwxr-xr-x | hostname-post | 2 | ||||
-rwxr-xr-x | 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 @@ -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 |