diff options
| author | Suleyman Farajli <suleyman@farajli.net> | 2025-10-26 23:48:47 +0400 |
|---|---|---|
| committer | Suleyman Farajli <suleyman@farajli.net> | 2025-10-26 23:48:47 +0400 |
| commit | 960878d8d639eebea38a83b83ab64024caa407ac (patch) | |
| tree | b7624c8bba89a4cc7a25766dd6290c5d0f4a335f /scripts | |
| parent | 3fe89e107fdb41105fe1509efb285768bf6b7ca4 (diff) | |
fix(shot): set the default directory and create if needed
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/gui/shot | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/gui/shot b/scripts/gui/shot index 7404943..40be620 100755 --- a/scripts/gui/shot +++ b/scripts/gui/shot @@ -18,7 +18,7 @@ exit 0 check_program "scrot" -default_dir="${HOME}"/pics/screenshot +default_dir="${XDG_SCREENSHOT_DIR:-${HOME}/media/photo/screenshot}" s_flg="" while getopts "d:sh" option; do @@ -38,7 +38,10 @@ shift $((OPTIND - 1)) [ ${#} != 0 ] && invalid_use -[ -z "${input}" ] && input="${default_dir}" +if [ -z "${input}" ]; then + input="${default_dir}" + mkdir -p "${default_dir}" +fi outfile="${input}" |
