Tested changes! No more mktemp

This commit is contained in:
Jack L. Frost 2014-10-04 12:50:49 +04:00
parent 80ae0480b3
commit 28fd9cddde
1 changed files with 4 additions and 4 deletions

8
sup
View File

@ -47,7 +47,7 @@ sup.mktemp() {
} }
sup.scrot() { sup.scrot() {
local tmp_file_name local tmp_file
[[ "$scrot_exec" ]] || { scrot_exec=`which scrot`; } [[ "$scrot_exec" ]] || { scrot_exec=`which scrot`; }
[[ "$scrot_exec" ]] || { [[ "$scrot_exec" ]] || {
@ -58,14 +58,14 @@ sup.scrot() {
[[ "$flag_scrot_fullscreen" ]] || { scrot_args+=( '-s' ); } [[ "$flag_scrot_fullscreen" ]] || { scrot_args+=( '-s' ); }
[[ "$cfg_scrot_delay" ]] && { scrot_args+=( "-d $cfg_scrot_delay" ); } [[ "$cfg_scrot_delay" ]] && { scrot_args+=( "-d $cfg_scrot_delay" ); }
tmp_file_name="$(sup.mktemp "${cfg_tmp_dir}" "${cfg_screenshot_ext}")" tmp_file="$(sup.mktemp "${cfg_tmp_dir}" ".${cfg_screenshot_ext}")"
scrot "${scrot_args[@]}" "${cfg_tmp_dir}/$tmp_file_name" || { scrot "${scrot_args[@]}" "$tmp_file" || {
sup.err "Failed to take a screenshot." sup.err "Failed to take a screenshot."
return 1 return 1
} }
echo "${cfg_tmp_dir}/$tmp_file_name" echo "$tmp_file"
} }
sup.exclude() { sup.exclude() {