wmexit 973 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. #Exit from X, will cause return to xwin.
  3. #/sbin/pup_event_frontend_d will quit if this file exists...
  4. echo -n "exit" > /tmp/wmexitmode.txt
  5. #give time for /sbin/pup_event_frontend_d to quit.
  6. #w478 testing 2.6.18.1 kernel, pup_event_frontend_d did not exit when it
  7. #detected /tmp/wmeximode.txt, but became 'defunct'...
  8. KCNT=0
  9. PSPEFD="`ps -C pup_event_frontend_d | grep 'pup_event_front' | grep -v 'defunct'`"
  10. #while [ "`pidof pup_event_frontend_d`" != "" ];do
  11. while [ "$PSPEFD" != "" ];do
  12. sleep 0.5
  13. KCNT=`expr $KCNT + 1`
  14. [ $KCNT -gt 60 ] && break #30 secs.
  15. PSPEFD="`ps -C pup_event_frontend_d | grep 'pup_event_front' | grep -v 'defunct'`"
  16. done
  17. sleep 0.2
  18. sync
  19. if [ "`pidof xfce4-panel`" != "" ];then
  20. #killall xfce4-panel
  21. kill `pidof xfce4-panel`
  22. exit
  23. fi
  24. #w003
  25. CURRENTWM="`cat /etc/windowmanager`"
  26. kill -9 `pidof $CURRENTWM`
  27. ##exec killall $PREVIOUSWM
  28. ##exec killall X
  29. #killall X #default is SIGTERM.
  30. #sleep 1
  31. #exec killall -9 X #make sure X is killed.