We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a9640f8 + 91b4429 commit 8d66b6fCopy full SHA for 8d66b6f
Slide/exercise.html
@@ -51,10 +51,17 @@ <h2><font color="yellow">Exercise</font></h2>
51
<section>
52
<pre><code data-trim contenteditable>
53
#!/bin/bash
54
-echo "Sleeping for $1 minutes"
55
-sleep $(expr $1 \* 60)
56
-echo -e "\a" # Alarm
57
-echo "Time up"
+
+# This script asks the user for a time, waits the specified amount
+# of time, and shows an alert dialog.
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."
65
</code></pre>
66
</section>
67
0 commit comments