Advertisement
Guest User

Untitled

a guest
Jul 31st, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  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 Control+space"
  10. sleep 3
  11. 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
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement