SHARE
TWEET

Untitled

a guest Jun 12th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. mkdir -p ~/Screencasts
  4. pid="/tmp/screencast.pid"
  5.  
  6. start () {
  7.     slop=$(slop -f "%x %y %w %h %g %i") || exit 1
  8.     read -r X Y W H G ID < <(echo $slop)
  9.     notify-send -t 3000 "Starting 3 seconds..." "Stop the cast by pressing Mod-r"
  10.     sleep 3
  11.     ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse ~/Screencasts/`date +%Y-%m-%d.%H:%M:%S`.mp4 & echo $! > $pid
  12. }
  13.  
  14. stop() {
  15.     kill -INT `cat $pid`
  16.     rm $pid
  17.     notify-send "Screencast Stopped" "The video was saved into ~/Screencasts folder."
  18. }
  19.  
  20. if [ -f "$pid" ]; then
  21.     stop
  22. else
  23.     start
  24. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top