Ax-Shell
Ax-Shell copied to clipboard
XDG_VIDEOS_DIR not being checked for emptiness in screenrecord.sh
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
- Run
screenrecord.shon a system whereXDG_VIDEOS_DIRis not set - The script fails with an error related to the unset variable
Expected Behavior
The script should:
- Check if
XDG_VIDEOS_DIRis set and non-empty - 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)