diff --git a/save_screen.sh b/save_screen.sh index e670a2e..3945606 100755 --- a/save_screen.sh +++ b/save_screen.sh @@ -1,7 +1,16 @@ #!/bin/sh + +DIRFILE="$HOME/.surf/lastsavedir" + +lastdir=$(cat "$DIRFILE") +if [ -n "$lastdir" ]; then + cd "$lastdir" +fi + filename=$(basename -s ".html" "$1") file=$(zenity --file-selection --save --filename="$filename.html") if [ -n "$file" ]; then cat > "$file" + dir=$(dirname "$file") + echo "$dir" > "$DIRFILE" fi -