aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2014-05-13 16:21:31 +0300
committerFilipp Lepalaan <f@230.to>2014-05-13 16:21:31 +0300
commit1abf43239a6c460a8b955a7ad79bab2193b77a3c (patch)
tree24d32f191be30d77ea337d92c67df834eb69afc8
parentee7d77fa817b0576de904ccfd07ed7ebeff603ce (diff)
downloadRetrospect-1abf43239a6c460a8b955a7ad79bab2193b77a3c.tar.gz
Retrospect-1abf43239a6c460a8b955a7ad79bab2193b77a3c.tar.bz2
Retrospect-1abf43239a6c460a8b955a7ad79bab2193b77a3c.zip
Don't use ffmpegHEADmaster
-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