#!/bin/bash su -c 'dcop kmix MainApplication-Interface quit' debajyoti su -c 'artsshell suspend' debajyoti # last try - a bit forcefully fuser -k /dev/snd/* sleep 1 # verify ... numinstances=`fuser /dev/snd/* 2>&1 | wc -l` if [ $numinstances -ne 0 ]; then logger -s -t 'acpi_suspend' "Cannot kill the processes accessing sound devices. Manually stop the programs and then retry. Wont try to suspend any more."; exit 1 fi service sound stop service alsa stop chvt 1 echo mem > /sys/power/state modprobe i830 /root/emu/video_post service alsa start service sound start su -c 'artsplay /usr/share/sounds/KDE_Logout_3.ogg' debajyoti