Ax-Shell icon indicating copy to clipboard operation
Ax-Shell copied to clipboard

XDG_VIDEOS_DIR not being checked for emptiness in screenrecord.sh

Open Matelz opened this issue 1 year ago • 0 comments

The screenrecord.sh script currently fails when XDG_VIDEOS_DIR is unset because it doesn't verify whether the variable exists before using it. This causes an error when running the script on systems where the variable isn't configured.

Steps to Reproduce

  1. Run screenrecord.sh on a system where XDG_VIDEOS_DIR is not set
  2. The script fails with an error related to the unset variable

Expected Behavior
The script should:

  1. Check if XDG_VIDEOS_DIR is set and non-empty
  2. Fall back to a default directory (e.g., ~/Videos) if unset

Proposed Solution
Add this check at the beginning of the script:

if [ -z "$XDG_VIDEOS_DIR" ]; then
    XDG_VIDEOS_DIR="$HOME/Videos"
fi

(This check is actually present in the screenshot.sh script but not on this one)

Matelz avatar Mar 25 '25 15:03 Matelz