surf/save_screen.sh

17 lines
326 B
Bash
Raw Normal View History

#!/bin/sh
2021-03-14 16:28:41 +01:00
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"
2021-03-14 16:28:41 +01:00
dir=$(dirname "$file")
echo "$dir" > "$DIRFILE"
fi