aboutsummaryrefslogtreecommitdiffstats
path: root/retrospect.rb
diff options
context:
space:
mode:
Diffstat (limited to 'retrospect.rb')
-rwxr-xr-x[-rw-r--r--]retrospect.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/retrospect.rb b/retrospect.rb
index 348a0e4..e1b6288 100644..100755
--- a/retrospect.rb
+++ b/retrospect.rb
@@ -1,15 +1,19 @@
+#! /usr/bin/env ruby -w
+
SECONDS = 10
OUTPUT = "/tmp/movie.mov"
BASEDIR = File.dirname(File.realpath(__FILE__))
+COMPNAME = `/usr/sbin/networksetup -getcomputername`
-trap(:ALRM) {
- system "#{BASEDIR}/ffmpeg", '-y', '-i', "/tmp/img_%d.jpg", OUTPUT
- system "/usr/bin/open", OUTPUT
-}
+trap(:INT) do
+ puts 'This is the first signal handler'
+ exit
+end
i = 0
while true do
- system "/usr/sbin/screencapture", '-t', 'jpg', "/tmp/img_#{i}.jpg"
+ outfile = "/tmp/img_#{COMPNAME}_#{i}.jpg"
+ system "/usr/sbin/screencapture", '-t', 'jpg', outfile
i = i + 1
sleep 1
end