Sending session DBus message from system cron job?
I'd like to disable the desktop search indexer while the cron-triggered
backup is running. I've figured out the relevant DBus messages I need
for that:
qdbus org.kde.nepomuk.services.nepomukstrigiservice \
/nepomukstrigiservice isSuspended
qdbus org.kde.nepomuk.services.nepomukstrigiservice \
/nepomukstrigiservice suspend
qdbus org.kde.nepomuk.services.nepomukstrigiservice \
/nepomukstrigiservice resume
I'm still looking for an elegant way to find all running sessions.
Currently, the best I can think of looks something like this
. /usr/share/acpi-support/power-funcs
CMD=one of the above
for x in /tmp/.X11-unix/* ; do
displaynum=`echo $x | sed s,/tmp/.X11-unix/X,,`
getXuser
if [ x"$XUSER" != x"" ] ; then
su -c "$CMD" $XUSER
fi
done
Well, it works, but it sure isn't elegant.
Michael
--
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/
Reply to: