Portsample
2007-11-26 05:09:52 UTC
Hey all,
I've written a little script that I run via cron job to close down my
mail reader at the end of the day. I would like add a 30 second countdown
to the xmessage popup. Is there an easy way to do this?
Below is my script so far minus the timer. Thanks.
#!/bin/sh
DISPLAY=:0.0 xmessage \
-center\
-title WARNING \
-timeout 15 \
-buttons AbortShutdown:3,Shutdown:2 -default Shutdown \
" Evolution mail reader will shutdown in 90 seconds. "\
case $? in
0) exit 0 ;; #"0" returned if xmessage timeout
1) exit 0 ;; #"1" returned if xmessage window is closed
2) DISPLAY=:0.0 xmessage -button "" -timeout 1 -center
"EVOLUTION closing now." && evolution --force-shutdown && exit 0;;
3) DISPLAY=:0.0 xmessage -button "" -timeout 1 -center
"EVOLUTION shutdown stopped" && exit 0;;
*) break ;;# ...covers "other" returned values, (Exceptions)
esac
exit 0
I've written a little script that I run via cron job to close down my
mail reader at the end of the day. I would like add a 30 second countdown
to the xmessage popup. Is there an easy way to do this?
Below is my script so far minus the timer. Thanks.
#!/bin/sh
DISPLAY=:0.0 xmessage \
-center\
-title WARNING \
-timeout 15 \
-buttons AbortShutdown:3,Shutdown:2 -default Shutdown \
" Evolution mail reader will shutdown in 90 seconds. "\
case $? in
0) exit 0 ;; #"0" returned if xmessage timeout
1) exit 0 ;; #"1" returned if xmessage window is closed
2) DISPLAY=:0.0 xmessage -button "" -timeout 1 -center
"EVOLUTION closing now." && evolution --force-shutdown && exit 0;;
3) DISPLAY=:0.0 xmessage -button "" -timeout 1 -center
"EVOLUTION shutdown stopped" && exit 0;;
*) break ;;# ...covers "other" returned values, (Exceptions)
esac
exit 0