Skip to content

Instantly share code, notes, and snippets.

@badosu
Created June 2, 2026 13:51
Show Gist options
  • Select an option

  • Save badosu/c853677776f7b83c3d547dcf78273ab7 to your computer and use it in GitHub Desktop.

Select an option

Save badosu/c853677776f7b83c3d547dcf78273ab7 to your computer and use it in GitHub Desktop.
Useful custom scripts and binaries ~/.local/bin
#!/bin/env bash
# Tool for recording screen
# - If already recording, stop recording, notify finished recording and exit
# - Otherwise, ask for screen area
# - If no area selected (e.g. pressed esc), notify recording cancelled and exit
# - Notify a 3 second countdown and start recording
# If already recording, stop recording, notify finished recording and exit
pgrep -x "wf-recorder" && pkill -INT -x wf-recorder && notify-send -h string:wf-recorder:record -t 1000 "Finished Recording" && exit 0
SLURP_AREA="$(slurp)"
# If no area selected (e.g. pressed esc), notify recording cancelled and exit
if [ -z "$SLURP_AREA" ]; then
notify-send -h string:wf-recorder:record "Recording cancelled"
exit 0
fi
echo "AREA $SLURP_AREA"
notify-send -h string:wf-recorder:record -t 1000 "Recording in:" "<span color='#90a4f4'><i><b>3</b></i></span>"
sleep 1
notify-send -h string:wf-recorder:record -t 1000 "Recording in:" "<span color='#90a4f4'><i><b>2</b></i></span>"
sleep 1
notify-send -h string:wf-recorder:record -t 950 "Recording in:" "<span color='#90a4f4'> <i><b>1</b></i></span>"
sleep 1
dateTime=$(date +%m-%d-%Y-%H:%M:%S)
wf-recorder -g "${SLURP_AREA}" --bframes max_b_frames -f "${HOME}/Videos/Screen/screencap-${dateTime}.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment