Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Cleanup any bad state we left behind if the user exited while flash was
  4. # running
  5. gconftool-2 -s /apps/gnome-screensaver/idle_activation_enabled --type bool true
  6.  
  7. we_turned_it_off=0
  8.  
  9. while true; do
  10. sleep 60
  11. flash_on=0
  12.  
  13. for pid in `pgrep firefox` ; do
  14. if grep libflashplayer /proc/$pid/maps > /dev/null ; then
  15. flash_on=1
  16. fi
  17.  
  18. ss_on=`gconftool-2 -g /apps/gnome-screensaver/idle_activation_enabled`
  19.  
  20. if [ "$flash_on" = "1" ] && [ "$ss_on" = "true" ]; then
  21. gconftool-2 -s /apps/gnome-screensaver/idle_activation_enabled \
  22. --type bool false
  23. we_turned_it_off=1
  24. elif [ "$flash_on" = "0" ] && [ "$ss_on" = "false" ] \
  25. && [ "$we_turned_it_off" = "1" ]; then
  26. gconftool-2 -s /apps/gnome-screensaver/idle_activation_enabled \
  27. --type bool true
  28. we_turned_it_off=0
  29. fi
  30.  
  31. done
  32. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement