Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ============== error message ====================
- (zenity:14713): Gtk-WARNING **: GTK+ module /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
- GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
- Gtk-Message: Failed to load module "canberra-gtk-module"
- =============== the script =======================
- #!/bin/bash
- if [ -z "$1" ]
- then
- minutes=60
- else
- minutes=$1
- fi
- let "timeout=minutes * 60"
- counter=0
- zenity --info --text "Next alert in $minutes minutes ($timeout seconds)" --title "Decub Launched"
- exec 3> >(zenity --notification --listen)
- echo "icon:/home/xh/.icons/decubb_21.png" >&3
- while true ; do
- echo "tooltip: DECUB Minutes Elapsed: $counter" >&3
- sleep 60
- let counter++
- echo $counter
- if [ $counter -eq $minutes ]
- then
- counter=0
- 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..."
- if [ $? = 1 ]
- then
- zenity --question --text='Really shut down now?' --ok-label='sudo shutdown -h now' --cancel-label='Keep working' && sudo shutdown -h now
- #exit
- #exec 3>&-
- fi
- fi
- done
Add Comment
Please, Sign In to add comment