if [ `pidof xscreensaver` ]; then
	su $user -c "(xscreensaver-command -throttle)"
		if [ x$LOCK_SCREEN = xtrue ]; then	
		su $user -c "(xscreensaver-command -lock)"
	fi
elif [ `pidof dcopserver` ]; then
	dcop kdesktop KScreensaverIface lock
fi

if [ `pidof dcopserver` ]; then
	avail_sessions=`dcop --all-users --list-sessions | grep '.DCOP.*__0'`
    	# send the lock command to all sessions
    		for session in $avail_sessions; do
	    	# /dev/null because dcop warns if it can't connect to X (this is normal!)
	    	dcop --session "$session" --all-users kdesktop KScreensaverIface lock > /dev/null 2>&1
    done
fi

xset dpms force off
if [ x$RADEON_LIGHT = xtrue ]; then
    [ -x /usr/sbin/radeontool ] && radeontool light off
fi
