Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- mkdir -p ~/Screencasts
- pid="/tmp/screencast.pid"
- start () {
- slop=$(slop -f "%x %y %w %h %g %i") || exit 1
- read -r X Y W H G ID < <(echo $slop)
- notify-send -t 3000 "Starting 3 seconds..." "Stop the cast by pressing Control+space"
- sleep 3
- ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse ~/`date +%Y-%m-%d.%H:%M:%S`.mp4 & echo $! > $pid
- }
- stop() {
- kill -INT `cat $pid`
- rm $pid
- notify-send "Screencast Stopped" "The video was saved into ~/Screencasts folder."
- }
- if [ -f "$pid" ]; then
- stop
- else
- start
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement