Guest User

Untitled

a guest
Dec 11th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. ============== error message ====================
  2.  
  3. (zenity:14713): Gtk-WARNING **: GTK+ module /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
  4. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
  5. Gtk-Message: Failed to load module "canberra-gtk-module"
  6.  
  7. =============== the script =======================
  8. #!/bin/bash
  9.  
  10. if [ -z "$1" ]
  11. then
  12. minutes=60
  13. else
  14. minutes=$1
  15. fi
  16.  
  17. let "timeout=minutes * 60"
  18.  
  19. counter=0
  20.  
  21. zenity --info --text "Next alert in $minutes minutes ($timeout seconds)" --title "Decub Launched"
  22.  
  23. exec 3> >(zenity --notification --listen)
  24.  
  25. echo "icon:/home/xh/.icons/decubb_21.png" >&3
  26.  
  27. while true ; do
  28. echo "tooltip: DECUB Minutes Elapsed: $counter" >&3
  29. sleep 60
  30.  
  31. let counter++
  32. echo $counter
  33.  
  34. if [ $counter -eq $minutes ]
  35. then
  36. counter=0
  37. zenity --question --text="Decub time: `date '+%A, %k:%M'`" --title="Decub Trigger" --ok-label="Sleep again for $minutes minutes ($timeout seconds)" --cancel-label="Shut down..."
  38. if [ $? = 1 ]
  39. then
  40. zenity --question --text='Really shut down now?' --ok-label='sudo shutdown -h now' --cancel-label='Keep working' && sudo shutdown -h now
  41. #exit
  42. #exec 3>&-
  43. fi
  44. fi
  45. done
Add Comment
Please, Sign In to add comment