Scrot: Log where the file was saved and fix bug with empty filename

This commit is contained in:
Dylan Araps 2017-03-27 08:45:12 +11:00
parent 4659863737
commit 1e6804f54a

View file

@ -2518,6 +2518,8 @@ to_off() {
take_scrot() {
scrot_program "${scrot_dir}${scrot_name}" 2>/dev/null
err "Scrot: Saved screenshot as: ${scrot_dir}${scrot_name}"
[[ "$scrot_upload" == "on" ]] && scrot_upload
}
@ -2557,15 +2559,16 @@ scrot_upload() {
scrot_args() {
scrot="on"
case "$2" in
"-"* | "") ;;
*)
if [[ "$2" =~ \.(png|jpg|jpe|jpeg|gif)$ ]]; then
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
;;
esac
[[ -z "$@" ]] && scrot_dir="${PWD:+${PWD}/}"
elif [[ -d "$2" ]]; then
scrot_dir="$2"
else
scrot_dir="${PWD:+${PWD}/}"
fi
}
scrot_program() {