Created
June 1, 2011 04:10
-
-
Save maha-dev/1001775 to your computer and use it in GitHub Desktop.
ubuntu: screen capture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#sudo apt-get install ffmpeg screen libnotify-bin | |
existing=`ps -ef | grep 'SCREEN -d -m -t screen-cap' | grep -v grep | awk '{print $2}'` | |
if [ -z "$existing" ] | |
then | |
screen -d -m -t screen-cap ffmpeg -y -f x11grab -vc x264 -s 1366x700 -r 30 -b 2000k -g 300 -i :0.0+0,40 ~/Desktop/session-recording.avi | |
existing=`ps -ef | grep 'SCREEN -d -m -t screen-cap' | grep -v grep | awk '{print $2}'` | |
notify-send "Screen Capture in progress pid:$existing" "Click the capture button again to end it." | |
else | |
kill -3 "$existing" | |
ps=`ps -ef | grep 'SCREEN -d -m -t screen-cap' | grep -v grep | awk '{print $2}'` | |
notify-send "Killing screen-cap $existing", "recheck; none existing: pid:$ps" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add to Panel -> Custom Application Launcher -> Launcher properties
Application Type: Application in Terminal
Name: screen-cap
Command: /path/to/bin/screen-cap
Choose a nice icon and press OK