Skip to content

Commit 91b4429

Browse files
author
shrimadhav u k
committed
update exercise answer
1 parent 0607cea commit 91b4429

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Slide/exercise.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ <h2><font color="yellow">Exercise</font></h2>
5151
<section>
5252
<pre><code data-trim contenteditable>
5353
#!/bin/bash
54-
echo "Sleeping for $1 minutes"
55-
sleep $(expr $1 \* 60)
56-
echo -e "\a" # Alarm
57-
echo "Time up"
54+
55+
# This script asks the user for a time, waits the specified amount
56+
# of time, and shows an alert dialog.
57+
58+
TIME=$(zenity --entry --title="Timer" --text="Enter a duration for the timer.\n\n Use 5s for 5 seconds, 10m for 10 minutes, or 2h for 2 hours.")
59+
60+
sleep ${TIME}
61+
62+
cvlc --play-and-exit Beep-sound.ogg # Alarm
63+
64+
zenity --info --title="Timer Complete" --text="The timer is over."
5865
</code></pre>
5966
</section>
6067

0 commit comments

Comments
 (0)