Created
June 2, 2026 13:51
-
-
Save badosu/c853677776f7b83c3d547dcf78273ab7 to your computer and use it in GitHub Desktop.
Useful custom scripts and binaries ~/.local/bin
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/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