<commit_before>#!/usr/bin/env bash

function record_screen {
  ffmpeg -f x11grab \
  -s $(xdpyinfo | grep dimension | awk '{print $2}') \
  -i $DISPLAY ~/videos/out.mkv
  notify-send "started recording screen"
}

function record_screen_with_mic {
  ffmpeg -f x11grab \
  -s $(xdpyinfo | grep dimension | awk '{print $2}') \
  -i $DISPLAY -f alsa -i default ~/videos/out.mkv
  notify-send "started recording screen with mic"
}

function record_webcam {
  ffmpeg -i /dev/video0 ~/videos/out.mkv
  notify-send "started recording webcam"
}

function record_webcam_with_mic {
  ffmpeg -i /dev/video0 -f alsa -i default ~/videos/out.mkv
  notify-send "started recording webcam with mic"
}

function stream_webcam_internal {
  mpv av://v4l2:/dev/video0
  notify-send "started streaming internal webcam"
}

function stream_webcam_external {
  mpv av://v4l2:/dev/video2
  notify-send "started streaming external webcam"
}

function keys_on {
  screenkey &
  notify-send "screenkey on"
}

function keys_off {
  ps -ax | grep screenkey | grep -v grep | awk '{print $1}' | xargs kill -9
  notify-send "screenkey off"
}

function help {
    echo "
    screencast.sh is a simple script for recording screencasts,
    streaming videos from the webcam and displaying key strokes

    usage:

    record_screen             records video from screen
    record_screen_with_mic    records video from screen with sound from microphone
    record_webcam             records video from webcam
    record_webcam_with_mic    records video from webcam with sound from microphone
    stream_webcam_internal    streams built-in laptop webcam with mpv
    stream_webcam_external    streams external connected webcam with mpv<commit_msg>updating notifications in screencast.sh script<commit_after>#!/usr/bin/env bash

function record_screen {
  notify-send "started recording screen"
  ffmpeg -f x11grab \
  -s $(xdpyinfo | grep dimension | awk '{print $2}') \
  -i $DISPLAY ~/videos/out.mkv
}

function record_screen_with_mic {
  notify-send "started recording screen with mic"
  ffmpeg -f x11grab \
  -s $(xdpyinfo | grep dimension | awk '{print $2}') \
  -i $DISPLAY -f alsa -i default ~/videos/out.mkv
}

function record_webcam {
  notify-send "started recording webcam"
  ffmpeg -i /dev/video0 ~/videos/out.mkv
}

function record_webcam_with_mic {
  notify-send "started recording webcam with mic"
  ffmpeg -i /dev/video0 -f alsa -i default ~/videos/out.mkv
}

function stream_webcam_internal {
  notify-send "started streaming internal webcam"
  mpv av://v4l2:/dev/video0
  notify-send "stopped streaming internal webcam"
}

function stream_webcam_external {
  notify-send "started streaming external webcam"
  mpv av://v4l2:/dev/video2
  notify-send "stopped streaming external webcam"
}

function keys_on {
  screenkey &
  notify-send "screenkey on"
}

function keys_off {
  ps -ax | grep screenkey | grep -v grep | awk '{print $1}' | xargs kill -9
  notify-send "screenkey off"
}

function help {
    echo "
    screencast.sh is a simple script for recording screencasts,
    streaming videos from the webcam and displaying key strokes

    usage:

    record_screen             records video from screen
    record_screen_with_mic    records video from screen with sound from microphone
    record_webcam             records video from webcam
    record_webcam_with_mic    records video from webcam with sound from microphone
    stream_webcam_internal    streams built-in laptop webcam with mpv
    stream_webcam_external    streams external connected webcam with mpv
{'fraction_non_alphanumeric': 0.07917723302338688, 'fraction_numerical': 0.009016624401239785, 'mean_word_length': 3.42643391521197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7182790', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1130, 'n_words': 367}