#!/bin/bash
sudo nautilus $@
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
#!/bin/bash
NAME="$(date +%d.%m.%Y_%H%M%S).gif"
DEFAULT_DURATION=10
echo -ne "Select area which will be recorded"
AREA="$(xrectsel)"
IFS=+ read DIM X Y <<< $AREA
IFS=x read W H <<< $DIM
echo ""
#read -p "Enter recording duration in seconds: " USERDUR
# Duration and output file
if [ $USERDUR -gt 0 ]; then
DURATION=$USERDUR
else
DURATION=$DEFAULT_DURATION
fi
echo "$DURATION sec. Recording has started..."
byzanz-record --cursor --duration=$DURATION --x=$X --y=$Y --width=$W --height=$H /tmp/"$NAME"
echo "Recording has ended."
if [ -f /tmp/"$NAME" ]; then
xviewer /tmp/"$name"
fi