diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 04:19:59 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 04:19:59 +0530 |
| commit | 3a6e45ad18c519b21c9cadb2d374148647886b05 (patch) | |
| tree | c8ad94d5be285a770a319e6a6a6fdda6021b652a /modules/media/screen-recording/screen-recording.sh | |
| parent | 574b4e4651495ed3fb14ef53a00374782d45b378 (diff) | |
| download | home-manager-config-3a6e45ad18c519b21c9cadb2d374148647886b05.tar.gz home-manager-config-3a6e45ad18c519b21c9cadb2d374148647886b05.zip | |
refactor: ran newly configured formatter for the whole project
Diffstat (limited to 'modules/media/screen-recording/screen-recording.sh')
| -rw-r--r-- | modules/media/screen-recording/screen-recording.sh | 49 |
1 files changed, 26 insertions, 23 deletions
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" |
