Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#!/bin/bash #this program captures a screenshot every second untill ctrl+C is pressed. #On exit, convert images to a gif. #This program requires gnome-screenshot, coreutils, and imagemagic #Should you want to quit, without the exit process, press ctrl+Z CDIR=$PWD #make a temporary location to store files. export TMPDIR=`mktemp -d $PWD/screenCap.XXXXXX` # trap ctrl-c and call ctrl_c() trap ctrl_c INT FName=$(date +%Y-%m-%d%H-%M-%S).gif function ctrl_c() { echo "** Trapped CTRL-C Exit process initializing" convert -delay 40 -loop 0 *.png $FName sleep 5 #convert is funny. cp $FName $CDIR echo -e $FName " complete. Exiting " rm -rf $TMPDIR exit } cd $TMPDIR N=1 while true do gnome-screenshot -f $(date +%Y-%m-%d%H-%M-%S).png echo -e "you have captured" $N "frames\n" N=$((N + 1)) sleep 1 done
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)