From 1abf43239a6c460a8b955a7ad79bab2193b77a3c Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 13 May 2014 16:21:31 +0300 Subject: Don't use ffmpeg --- retrospect.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) mode change 100644 => 100755 retrospect.rb diff --git a/retrospect.rb b/retrospect.rb old mode 100644 new mode 100755 index 348a0e4..e1b6288 --- 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 -- cgit v1.2.3