Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

countdown timer

  • Loading branch information...
commit 32e56a3ddd0e920cbc079205bd8d6934809f1689 1 parent 79f97a4
@Gcool authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 countdown
View
20 countdown
@@ -0,0 +1,20 @@
+#!/usr/bin/ruby
+
+class Countdown
+ def initialize
+ @time = "1"
+ end
+
+ def wait
+ @time = `yad --entry --entry-text="#{@time}" --entry-label="Enter countdown time (in minutes)" --numeric`.chomp
+ exit 0 if @time == ""
+ puts "Sleeping for #{@time.to_f*60} seconds."
+ sleep @time.to_f * 60
+ end
+end
+
+my = Countdown.new
+while true
+ my.wait
+ sleep 1
+end
Please sign in to comment.
Something went wrong with that request. Please try again.