diff options
author | Filipp Lepalaan <f@230.to> | 2014-05-13 16:21:31 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2014-05-13 16:21:31 +0300 |
commit | 1abf43239a6c460a8b955a7ad79bab2193b77a3c (patch) | |
tree | 24d32f191be30d77ea337d92c67df834eb69afc8 | |
parent | ee7d77fa817b0576de904ccfd07ed7ebeff603ce (diff) | |
download | Retrospect-1abf43239a6c460a8b955a7ad79bab2193b77a3c.tar.gz Retrospect-1abf43239a6c460a8b955a7ad79bab2193b77a3c.tar.bz2 Retrospect-1abf43239a6c460a8b955a7ad79bab2193b77a3c.zip |
-rwxr-xr-x[-rw-r--r--] | retrospect.rb | 14 |
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 |