Advertisement
layr

suspend_script

Jun 15th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 22.00 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Auto suspend and wake-up script. It's intended to act as an alarm-clock.
  4. #
  5. # Puts the computer on standby (after pre-defined time) and automatically wakes it up and executes commands at specified time or
  6. # executes commands after given sleep period.
  7. #
  8. # Written by Romke van der Meulen <redge.online at gmail>
  9. # Edited by Laur Aliste <laur.aliste at gmail>
  10. #
  11. # -----------------------------------------------------
  12. # If you want the script to work without typing any passwords, you have to edit sudoers file:
  13. # sudo visudo
  14. # go to the last line and enter this line (without the '# ' at the beginning!) and save:
  15. # username    ALL=NOPASSWD: /usr/sbin/rtcwake
  16. #
  17. # !!! This step is only needed if you're going to use (long) pre-suspend sleep periods; if so, sudo might
  18. # expire before 'sudo rtcwake' command is executed and system won't suspend !!!
  19. # -----------------------------------------------------
  20. ##### USAGE #####
  21. #
  22. # 3 usage methods:
  23. #   1. Suspending to RAM:
  24. #       Example: suspend_script 930 15      - suspends system after 15 min and wakes up at  9:30
  25. #            suspend_script 18:45 10    - suspends system after 10 min and wakes up at 18:45
  26. #            suspend_script 03:25 2     - suspends system after  2 min and wakes up at 03:25
  27. #            suspend_script 515     - If the second argument (pre-suspend sleep time) is missing as it is in this example,
  28. #                             the default value is 10 sec, so the system suspends after 10 sec
  29. #                             and wakes up at 05:15
  30. #   2. Sleeping until predefined time:
  31. #       Example: suspend_script 930 sleep   - executes pre-defined commands at 9:30
  32. #
  33. #   3. Sleeping for given time:
  34. #       Example: suspend_script sleep 31    - executes pre-defined commands after sleeping for 31 minutes
  35. #            suspend_script sleep       - If the second argument (sleep time) is missing as it is in this example,
  36. #                             the default value is 10 min, so the system executes pre-defined commands
  37. #                             after sleeping for 10 minutes
  38. #
  39. # This scripts provides also default wake-up time, in case you forget to set the alarm.
  40. # To use this functionality, set cron to run this script at the time you would like to get the default alarm with the 'automated' flag, for instance:
  41. #
  42. #   30 07 * * * /usr/local/bin/suspend_script automated
  43. #
  44. # would wake you up at 07:30, in case you forgot to set the clock. (this assumes the computer is running and 'notify-send' and 'zenity' are installed)
  45. #
  46. #
  47. #
  48. # - You can place this file (suspend_script) into /usr/local/bin. When you want to use the script, open terminal
  49. # and type "suspend_script TIMEVALUE SLEEPVALUE" or
  50. # - simply drag the scriptfile (located anywhere) into terminal window and add those two values to the end of command line.
  51. #
  52. # Don't forget to make this file executable!
  53. # ------------------------------------------------------
  54. command_play="ncmpcpp play" # Your command, that starts the (music) player. This example starts ncmpcpp player.
  55. command_pause="ncmpcpp pause"   # Command, that pauses the player defined in the above command.
  56. volume="80"         # Volume percentage on alarm start (without the '%' sign). Note it sets the sound card, not your program volume level.
  57. # ------------------------------------------------------
  58. export DISPLAY=:0.0
  59. # Default values; do not change:
  60. standalone_sleep=0
  61. suspend=1
  62. # A CONVENIENCE VARIABLE (same as running `basename $0`)
  63. zero=${0##*/}
  64. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  65.  
  66. # Here we create and manage a file containing PIDs of all our running instances of the this script:
  67. global_pidlist_file=$HOME/.PIDs/$zero.pids
  68. if [ ! -d $HOME/.PIDs ]; then
  69.     mkdir $HOME/.PIDs
  70. fi
  71. # PID collection:
  72. printf "$$\n" >>$global_pidlist_file
  73. trap "sed -i /$$/d $global_pidlist_file" EXIT
  74.  
  75. #====================== ALARM ROUTINE ==========================
  76. function alert {
  77.     # Wake up with monitor disabled:
  78.     # xset dpms force off
  79.  
  80.     # Clear the terminal window:
  81.     clear
  82.  
  83.     # Wait for internet connection:
  84.     sleep 5
  85.     # Display current WX (requires metar script to be installed):
  86.     metar EETU
  87.  
  88.     # Set volume level and (just in case) unmute system:
  89.     amixer -c 0 set Master playback $volume% unmute > /dev/null 2>&1
  90.     #amixer -c 0 set PCM playback $volume% unmute > /dev/null 2>&1
  91.  
  92.     echo -e "$welcome_message"
  93.  
  94.     # Start ncmpcpp:
  95.     $command_play > /dev/null 2>&1
  96.     # Postpone? :
  97.     echo -e "Want to sleep some more? (y/n)\n"
  98.     read postpone
  99.     while [[ "$postpone" == "y" ]]; do
  100.         $command_pause > /dev/null 2>&1
  101.         amixer -c 0 set Master playback 60% > /dev/null 2>&1
  102.         #amixer -c 0 set PCM 60% > /dev/null 2>&1
  103.         clear
  104.         echo -e "Enter time in minutes (leave blank for 10min):\n"
  105.         read sleep_value
  106.         if ! [[ -z $sleep_value ]]; then
  107.             if ! [[ "$sleep_value" =~ ^[0-9]+$ ]] ; then
  108.                 until [[ "$sleep_value" =~ ^[0-9]+$ ]] ; do
  109.                     clear
  110.                     echo "========================================================================="
  111.                     echo "      Error: sleep time (MM) has to be numerical."
  112.                     echo "             eg. 10; 20; 5.  Try again."
  113.                     echo "========================================================================="
  114.                     echo -e "Enter time in minutes:\n"
  115.                     read sleep_value
  116.                 done
  117.             fi
  118.         fi
  119.         if [[ $sleep_value > 0 ]];then
  120.             sleep_value=$(( $sleep_value*60 ))
  121.         else
  122.             sleep_value=600
  123.         fi
  124.         # Define hours/mins/sec until wake-up:
  125.         hours=$(( $sleep_value/3600 ))
  126.         minutes=$((  ($sleep_value-$hours*3600)/60  ))
  127.         seconds=$(( $sleep_value-($hours*3600+$minutes*60)  ))
  128.         while [ $sleep_value -gt 0 ]; do
  129.             clear
  130.             # Let user know what we're going to do
  131.             if [[ $hours > 0 ]] ;then
  132.                 echo "Going to sleep for $hours h $minutes min"
  133.             else
  134.                 echo "Going to sleep for $minutes min"
  135.             fi
  136.             let sleep_value=$sleep_value-1  
  137.         hours2=$(( $sleep_value/3600 ))
  138.         minutes2=$((  ($sleep_value-$hours2*3600)/60  ))
  139.         seconds2=$(( $sleep_value-($hours2*3600+$minutes2*60)  ))
  140.             echo "----------------------------------------------------------"
  141.             if [[ $hours2 > 0 ]] ;then
  142.                 echo "Waking up in... $hours2 h $minutes2 min $seconds2 sec"
  143.             elif [[ $minutes2 > 0 ]] ;then
  144.                 echo "Waking up in... $minutes2 min $seconds2 sec"
  145.             else
  146.                 echo "Waking up in... $seconds2 sec"
  147.             fi
  148.             sleep 1
  149.         done
  150.         amixer -c 0 set Master playback $volume% unmute > /dev/null 2>&1
  151.         #amixer -c 0 set PCM $volume% unmute > /dev/null 2>&1
  152.         $command_play > /dev/null 2>&1
  153.         clear
  154.         echo -e "Want to sleep some more? (y/n)\n"
  155.         read postpone
  156.     done
  157.  
  158.     # Unload rtcwake if it's running, otherwise next time computer won't wake up from sleep:
  159.     killall rtcwake > /dev/null 2>&1
  160.     exit
  161. }
  162. #==============================================================
  163. # Check whether the help output is requested:
  164. case $1 in
  165.     "-h" | "--help" )
  166. clear
  167. printf "
  168.  Auto suspend and wake-up script. It's intended to act as an alarm-clock.
  169. 3 usage methods:
  170.  
  171. 1. Suspending to RAM:
  172.   Example: '$zero 930 15'   - suspends system after 15 min
  173.                               and wakes up at  9:30
  174.         '$zero 18:45 10' - suspends system after 10 min
  175.                               and wakes up at 1845
  176.         '$zero 0325 2'   - suspends system after  2 min
  177.                               and wakes up at 03:25
  178.         '$zero 5:15'     - If the second argument (pre-suspend
  179.                               sleep time) is missing as it is in this example,
  180.                    the default value is 10 sec, so the system
  181.                               suspends after 10 sec and wakes up at 05:15
  182.  
  183. 2. Sleeping until predefined time (i.e. without suspending):
  184.   Example: '$zero 930 sleep'      - executes pre-defined commands at 9:30
  185.            '$zero 10:20 sleep 60' - if there's third argument defined, it
  186.                                      will describe volume percentage, so the
  187.                                      alarm will set off at 10:20 with 60 perc. vol.
  188.  
  189.  3. Sleeping for given time:
  190.    Example: '$zero sleep 31'        - executes pre-defined commands after
  191.                                       sleeping for 31 minutes
  192.             '$zero sleep 31 75'     - same case as above - if there's third
  193.                                      argument, it'll be the volume percentage.
  194.             '$zero sleep'           - If the second argument (sleep time)
  195.                                       is missing as it is in this example,
  196.                                       the default value is 10 min, so the
  197.                                       system executes pre-defined commands
  198.                                       after sleeping for 10 minutes
  199.  
  200.  This scripts provides also default wake-up time, in case you forget to set the
  201.  alarm. To use this functionality, set cron to run this script at the time you
  202.  would like to get the default alarm with the 'automated' flag, for instance:
  203.  
  204.     30 07 * * * /usr/local/bin/$zero automated
  205.  
  206.  would wake you up at 07:30, in case you forgot to set the clock. (this assumes
  207.  the computer is running and 'notify-send' and 'zenity' are installed)
  208.  
  209.  
  210.  
  211.  - You can place this file ($zero) into /usr/local/bin.
  212.  When you want to use the script, open terminal and type
  213.  '$zero TIMEVALUE SLEEPVALUE' or
  214.  - simply drag the scriptfile (located anywhere) into terminal window and add
  215.    those two values to the end of command line.
  216.  
  217.  Don't forget to make this file executable!
  218. -------------------------------------------------------------------
  219. "; exit 0
  220.     ;;
  221. esac
  222. # Argument check:
  223. if [[ $# > 3 ]]; then
  224.     clear
  225.     echo "==============================================================================="
  226.     echo "      Error: too many arguments;"
  227.     echo "      only wake-up time, sleep or volume arguments are accepted"
  228.     echo "==============================================================================="; exit 1
  229. elif [[ $# < 1 ]]; then
  230.     clear
  231.     echo "====================================================="
  232.     echo "      Wake-up time (HHMM) or \"sleep\" needed"
  233.     echo "====================================================="; exit 1
  234. elif [[ "$1" == "automated" ]]; then
  235.     pid_count="$(cat $global_pidlist_file | sed '/^\s*#/d;/^\s*$/d' | wc -l)"
  236.     # Start the default wake-up-reel, if pid count = 1 (i.e. wake-up time was not previously defined, so other instances are not running):
  237.     if [[ "$pid_count" == "1" ]]; then
  238.         # Just in case display a message of oncoming alarm:
  239.         auto_abort=$(zenity --entry --width=300 --height=400 --timeout=10 --text="Enter any text and press OK in 10sec to abort the automatic wake-up!")
  240.         if ! [[ -z "$auto_abort" ]]; then
  241.             notify-send -t 5000 -i gtk-dialog-info "Automatic wake-up alarm aborted."
  242.         else
  243.  
  244.             # Set volume level and (just in case) unmute system:
  245.             amixer -c 0 set Master playback $volume% unmute > /dev/null 2>&1
  246.             #amixer -c 0 set PCM $volume% unmute > /dev/null 2>&1
  247.  
  248.             # Start ncmpcpp:
  249.             $command_play > /dev/null 2>&1
  250.             # Postpone? :
  251.             postpone=$(zenity --entry --width=400 --height=400 --text="Want to sleep some more? (y/n)")
  252.             while [[ "$postpone" == "y" ]]; do
  253.                 $command_pause > /dev/null 2>&1
  254.                 amixer -c 0 set Master playback 60% > /dev/null 2>&1
  255.                 #amixer -c 0 set PCM 60% > /dev/null 2>&1
  256.                 sleep_value=$(zenity --entry --width=400 --height=400 --text="Enter time in minutes (leave blank for 10min)")
  257.                 if ! [[ -z $sleep_value ]]; then
  258.                     until [[ "$sleep_value" =~ ^[0-9]+$ ]] ; do
  259.                         zenity --error --width=400 --height=400 --text "Error: sleep time (MM) has to be numerical, eg. 10; 20; 5"
  260.                         sleep_value=$(zenity --entry --width=400 --height=400 --text="Enter time in minutes:")
  261.                     done
  262.                 fi
  263.                 if [[ $sleep_value > 0 ]];then
  264.                     sleep_value=$(( $sleep_value*60 ))
  265.                 else
  266.                     sleep_value=600
  267.                 fi
  268.                 notify-send -t 5000 -i gtk-dialog-info "Ok, sleeping for another $(( $sleep_value / 60 )) minutes."
  269.                 sleep $sleep_value
  270.                 amixer -c 0 set Master playback $volume% unmute > /dev/null 2>&1
  271.                 #amixer -c 0 set PCM $volume% unmute > /dev/null 2>&1
  272.                 $command_play > /dev/null 2>&1
  273.                 postpone=$(zenity --entry --width=400 --height=400 --text="Want to sleep some more? (y/n)")
  274.             done
  275.             # Unload rtcwake if it's running, otherwise next time computer won't wake up from sleep:
  276.             killall rtcwake > /dev/null 2>&1
  277.         fi
  278.     fi
  279.     exit 0
  280. elif [[ "$1" == "sleep" ]] ; then
  281.     standalone_sleep=1
  282.     suspend=0
  283.     if ! [[ -z $2 ]]; then
  284.         if ! [[ "$2" =~ ^[0-9]+$ ]] ; then
  285.             clear
  286.             echo "========================================================================="
  287.             echo "      Error: sleep value (MM) has to be numerical."
  288.             echo "             eg. 10; 200; 5"
  289.             echo "========================================================================="; exit 1
  290.         fi
  291.     fi
  292.     if ! [[ -z $3 ]]; then
  293.         if ! [[ "$3" =~ ^[0-9]+$ ]] ; then
  294.             clear
  295.             echo "========================================================================="
  296.             echo "      Error: volume percentage has to be numerical."
  297.             echo "             eg. 50; 60; 75"
  298.             echo "========================================================================="; exit 1
  299.         else
  300.             volume="$3"
  301.         fi
  302.     fi
  303. elif ! [[ "$1" =~ ^[0-9:]+$ ]]; then
  304.     clear
  305.     echo "=============================================================="
  306.     echo "    Error: first argument has to be either numerical (HHMM)"
  307.     echo "           eg. 1000; 900; 18:30;  or \"sleep\""
  308.     echo "=============================================================="; exit 1
  309. elif ! [[ -z $2 ]]; then
  310.     if [[ "$2" == "sleep" ]] ; then
  311.         suspend=0
  312.         if ! [[ -z $3 ]]; then
  313.             if ! [[ "$3" =~ ^[0-9]+$ ]] ; then
  314.                 clear
  315.                 echo "========================================================================="
  316.                 echo "      Error: volume percentage has to be numerical."
  317.                 echo "             eg. 50; 60; 75"
  318.                 echo "========================================================================="; exit 1
  319.             else
  320.                 volume="$3"
  321.             fi
  322.         fi
  323.     elif ! [[ "$2" =~ ^[0-9]+$ ]] ; then
  324.         clear
  325.         echo "========================================================================="
  326.         echo "      Error: second argument has to be either numerical (MM)"
  327.         echo "             eg. 10; 200; 5;  or \"sleep\""
  328.         echo "========================================================================="; exit 1
  329.     fi
  330. fi
  331.  
  332. # Check whether specified time is today or tomorrow and define suspend period:
  333. if [[ $standalone_sleep == 0 ]]; then
  334.     TARGET1=$((`date +%s -d "$1"`))
  335.     NOW=$((`date +%s`))
  336.     if [ $TARGET1 -lt $NOW ]; then
  337.         TARGET1=$((`date +%s -d "$1"` + 24*60*60))
  338.     fi
  339.     TARGET2=$(($TARGET1-$NOW))
  340. fi
  341.  
  342. # Check whether the entered wake-up time makes any sense (this protects against ill-logical time values, as 1971, 2600 etc):
  343. if [[ "$1" =~ ^[0-9:]+$ ]] ; then
  344.     # Define hours/mins/sec until wake-up:
  345.     hours=$(($TARGET2/3600))
  346.     minutes=$((  ($TARGET2-($hours*3600))/60  ))
  347.     seconds=$(( $TARGET2-(($hours*3600)+($minutes*60))  ))
  348.     if (( $hours < 0 )); then
  349.         clear
  350.         echo "======================================================"
  351.         echo "       Error: please re-check the wake-up time"
  352.         echo "======================================================"; exit 1
  353.     fi
  354.     mins_=$(date  +%M -d "$1")
  355.     hours_=$(date  +%H -d "$1")
  356. fi
  357. # Decide whether to sleep or suspend; define pre-suspend sleep durance if necessary:
  358. if [[ "$suspend" == "1" ]]; then
  359.                 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  360. #-------------------------------#-#             SUSPEND SCRIPT              #-#--------------------------------#
  361.                 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  362.     killall rtcwake > /dev/null 2>&1
  363.     if [[ $2 > 0 ]];then
  364.     sleep_value=$(( $2*60 ))
  365.     else
  366.     sleep_value=10
  367.     fi
  368.     # Subtract 'sleep_value' from 'TARGET', otherwise the computer will wake up at desired time + sleep_value:
  369.     TARGET=$(( $TARGET2 - $sleep_value ))
  370.     # Print countdown feedback:
  371.     while [ $sleep_value -gt 0 ]; do
  372.         clear
  373.         # Let user know what we're going to do
  374.         echo "Going to suspend for $hours h $minutes min (waking up at $hours_:$mins_)"
  375.         let sleep_value=$sleep_value-1  
  376.         hours2=$(( $sleep_value/3600 ))
  377.         minutes2=$((  ($sleep_value-$hours2*3600)/60  ))
  378.         seconds2=$(( $sleep_value-($hours2*3600+$minutes2*60)  ))
  379.         echo "----------------------------------------------------------"
  380.         if [[ $hours2 > 0 ]] ;then
  381.             echo "To cancel, press Ctrl+c within the next $hours2 h $minutes2 min $seconds2 sec"
  382.         elif [[ $minutes2 > 0 ]] ;then
  383.             echo "To cancel, press Ctrl+c within the next $minutes2 min $seconds2 sec"
  384.         else
  385.             echo "To cancel, press Ctrl+c within the next $seconds2 sec"
  386.         fi
  387.         sleep 1
  388.     done
  389.  
  390.     #################################################################################################
  391.     #################################################################################################
  392.     # Between these double octothorpe (#) lines go optional commands
  393.     # which are to be executed BEFORE suspension:
  394.     #------------------------------------------------------------------------------------------------
  395.     # Kill conky:
  396.     pkill -9 -f conky > /dev/null 2>&1
  397.  
  398.     #################################################################################################
  399.     #################################################################################################
  400.  
  401.     # Feedback again:
  402.     echo "Suspending..."
  403.     sleep 1
  404.     # Set RTC wakeup time and suspend to RAM:
  405.     sudo rtcwake -m mem -s $TARGET
  406.     # Buffer time...
  407.     sleep 2
  408.     #################################################################################################
  409.     #################################################################################################
  410.     # Between these double octothorpe (#) lines go optional commands
  411.     # which are to be executed AFTER suspension:
  412.     #------------------------------------------------------------------------------------------------
  413.  
  414.     # Start conky:
  415.     #conky -c $HOME/.conkyrc > /dev/null 2>&1
  416.     conky -d -c $HOME/.conky/.conkyrc_error_reporting > /dev/null 2>&1
  417.  
  418.     welcome_message="\n Good morning\n\n\n"
  419.     alert   # This is the default alarm routine defined above. Deleting not recommended (provides the wake-up routine).
  420.  
  421.  
  422.     #################################################################################################
  423.     #################################################################################################
  424. elif [[ "$standalone_sleep" == "1" ]]; then
  425.                 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  426. #-------------------------------#-#              SLEEP SCRIPT               #-#--------------------------------#
  427.                 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  428.  
  429.     #################################################################################################
  430.     #################################################################################################
  431.     # Between these double octothorpe (#) lines go optional commands
  432.     # which are to be executed BEFORE system sleep (standalone sleep):
  433.     #------------------------------------------------------------------------------------------------
  434.  
  435.  
  436.     #################################################################################################
  437.     #################################################################################################
  438.  
  439.     if [[ $2 > 0 ]];then
  440.     sleep_value=$(( $2*60 ))
  441.     else
  442.     sleep_value=600
  443.     fi
  444.  
  445.     # Define hours/mins/sec until wake-up:
  446.     hours=$(( $sleep_value/3600 ))
  447.     minutes=$((  ($sleep_value-$hours*3600)/60  ))
  448.     seconds=$(( $sleep_value-($hours*3600+$minutes*60)  ))
  449.     while [ $sleep_value -gt 0 ]; do
  450.         clear
  451.         # Let user know what we're going to do
  452.         if [[ $hours > 0 ]] ;then
  453.             echo "Going to sleep for $hours h $minutes min"
  454.         else
  455.             echo "Going to sleep for $minutes min"
  456.         fi
  457.         let sleep_value=$sleep_value-1  
  458.     hours2=$(( $sleep_value/3600 ))
  459.     minutes2=$((  ($sleep_value-$hours2*3600)/60  ))
  460.     seconds2=$(( $sleep_value-($hours2*3600+$minutes2*60)  ))
  461.         echo "----------------------------------------------------------"
  462.         if [[ $hours2 > 0 ]] ;then
  463.             echo "Waking up in... $hours2 h $minutes2 min $seconds2 sec"
  464.         elif [[ $minutes2 > 0 ]] ;then
  465.             echo "Waking up in... $minutes2 min $seconds2 sec"
  466.         else
  467.             echo "Waking up in... $seconds2 sec"
  468.         fi
  469.         sleep 1
  470.     done
  471. else
  472.     #################################################################################################
  473.     #################################################################################################
  474.     # Between these double octothorpe (#) lines go optional commands
  475.     # which are to be executed BEFORE system sleep (non-standalone sleep):
  476.     #------------------------------------------------------------------------------------------------
  477.  
  478.  
  479.     #################################################################################################
  480.     #################################################################################################
  481.     sleep_value=$TARGET2
  482.     while [ $sleep_value -gt 0 ]; do
  483.         clear
  484.         # Let user know what we're going to do
  485.         if [[ $hours > 0 ]] ;then
  486.             echo "Going to sleep for $hours h $minutes min $seconds s"
  487.         elif [[ $minutes > 0 ]] ;then
  488.             echo "Going to sleep for $minutes min $seconds s"
  489.         else
  490.             echo "Going to sleep for $seconds s"
  491.         fi
  492.         let sleep_value=$sleep_value-1  
  493.     hours2=$(( $sleep_value/3600 ))
  494.     minutes2=$((  ($sleep_value-$hours2*3600)/60  ))
  495.     seconds2=$(( $sleep_value-($hours2*3600+$minutes2*60)  ))
  496.         echo "----------------------------------------------------------"
  497.         if [[ $hours2 > 0 ]] ;then
  498.             echo "Waking up in... $hours2 h $minutes2 min $seconds2 sec"
  499.         elif [[ $minutes2 > 0 ]] ;then
  500.             echo "Waking up in... $minutes2 min $seconds2 sec"
  501.         else
  502.             echo "Waking up in... $seconds2 sec"
  503.         fi
  504.         sleep 1
  505.     done
  506. fi
  507.     #################################################################################################
  508.     #################################################################################################
  509.     # Between these double octothorpe (#) lines go optional commands
  510.     # which are to be executed AFTER system sleep (non-standalone and standalone sleep):
  511.     #------------------------------------------------------------------------------------------------
  512.     welcome_message="\n Wakey-wakey\n\n\n"
  513.     alert   # This is the default alarm routine defined above. Deleting not recommended (provides the wake-up routine).
  514.     #################################################################################################
  515.     #################################################################################################
  516. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement