From 3a6e45ad18c519b21c9cadb2d374148647886b05 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 24 Sep 2026 04:19:59 +0530 Subject: refactor: ran newly configured formatter for the whole project --- modules/media/screen-recording/screen-recording.sh | 49 ++++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'modules/media/screen-recording/screen-recording.sh') diff --git a/modules/media/screen-recording/screen-recording.sh b/modules/media/screen-recording/screen-recording.sh index 90cbc85..1afa239 100644 --- a/modules/media/screen-recording/screen-recording.sh +++ b/modules/media/screen-recording/screen-recording.sh @@ -5,36 +5,39 @@ OUT_DIR="$HOME/Videos/Recordings" mkdir -p "$OUT_DIR" -info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; } -warn() { printf '\033[1;33m==> warning:\033[0m %s\n' "$*" >&2; } +info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; } +warn() { printf '\033[1;33m==> warning:\033[0m %s\n' "$*" >&2; } error() { printf '\033[1;31m==> error:\033[0m %s\n' "$*" >&2; } -die() { error "$*"; exit 1; } +die() { + error "$*" + exit 1 +} # Argument parsing SELECT_MODE=false -while [[ "$#" -gt 0 ]]; do - case $1 in - -s|--select) SELECT_MODE=true ;; - esac - shift +while [[ $# -gt 0 ]]; do + case $1 in + -s | --select) SELECT_MODE=true ;; + esac + shift done # Geometry selection GEOMETRY="" if [ "$SELECT_MODE" = true ]; then - if command -v slurp >/dev/null 2>&1; then - info "Select a window or draw a box..." - GEOMETRY=$(slurp) - - if [ -z "$GEOMETRY" ]; then - info "Selection cancelled. Exiting." - exit 1 - fi - else - warn "slurp not found. Recording full screen..." - sleep 1 - fi + if command -v slurp >/dev/null 2>&1; then + info "Select a window or draw a box..." + GEOMETRY=$(slurp) + + if [ -z "$GEOMETRY" ]; then + info "Selection cancelled. Exiting." + exit 1 + fi + else + warn "slurp not found. Recording full screen..." + sleep 1 + fi fi # Start recording @@ -45,9 +48,9 @@ echo " Press 'q' in this terminal to stop." echo " File: $FILENAME" if [ -n "$GEOMETRY" ]; then - wf-recorder -g "$GEOMETRY" -f "$FILENAME" + wf-recorder -g "$GEOMETRY" -f "$FILENAME" else - wf-recorder -f "$FILENAME" + wf-recorder -f "$FILENAME" fi -info "Done! Video saved to $FILENAME" \ No newline at end of file +info "Done! Video saved to $FILENAME" -- cgit v1.2.3