remember last save directory

This commit is contained in:
gutmet 2021-03-14 16:28:41 +01:00
parent b1e3323c63
commit b4f5a1515f

View File

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