Browse Source

updated mrec and pbin

master
mort 9 years ago
parent
commit
310bddafe7
2 changed files with 24 additions and 13 deletions
  1. 4
    2
      bin/mrec
  2. 20
    11
      bin/pbin

+ 4
- 2
bin/mrec View File

echo "mrec <name>" echo "mrec <name>"
exit 1 exit 1
elif [ "$1" = "" ]; then #stop recording elif [ "$1" = "" ]; then #stop recording
sleep 5
name=$(cat ~/.mrecname) name=$(cat ~/.mrecname)
rm ~/.mrecname &>/dev/null rm ~/.mrecname &>/dev/null
sleep 0.2 sleep 0.2
mupload ~/.mrecfile.gif "img/${name}.ogv"
mupload ~/.mrecfile.gif "img/${name}.gif"
else #start recording else #start recording
rm ~/.mrecfile.gif &>/dev/null
rm ~/.mrecname &>/dev/null rm ~/.mrecname &>/dev/null
sleep 0.2 sleep 0.2
echo "$1" > ~/.mrecname echo "$1" > ~/.mrecname
byzanz-record -x "$X" -y "$Y" -w "$W" -h "$H" --delay 0 --exec=mrec-sleep ~/.mrecfile.gif &
mconv -y -f x11grab -video_size ${W}x${h} -i $DISPLAY -c:v ffvhuff -c:a none ~/.mrecfile.ogv
fi fi

+ 20
- 11
bin/pbin View File

#!/bin/sh
#!/bin/bash


url="www.pbin.in/upload.php" url="www.pbin.in/upload.php"


if [ "$1" = "" ]; then
echo "pbin <file> [name]"
exit
elif [ ! -s "$1" ]; then
echo "$1: no such file"
exit
stddata=$(cat -)

if [ "$stddata" = "" ]; then
if [ "$1" = "" ]; then
echo "pbin <file> [name]"
exit
elif [ ! -s "$1" ]; then
echo "$1: no such file"
exit
fi
fi fi


content=`cat $1`
if [ "$stddata" = "" ]; then
content=`cat $1`
name="$2"
else
content="$stddata"
name="$1"
fi


name=`curl "$url" -s -F "name=$2" -F "content=$content"`
pasteId=`curl "$url" -s -F "name=$name" -F "content=$content"`


if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "http://pbin.in/$name" | xclip
echo "http://pbin.in/$name"
echo "Your paste should now be at http://pbin.in/$pasteId"
else else
echo "There was an error. The file you provided may be too big." echo "There was an error. The file you provided may be too big."
fi fi

Loading…
Cancel
Save