summaryrefslogtreecommitdiff
path: root/.w3m/cgi-bin/fn_save_session.cgi
blob: fb9bd59c920cad54577f1dd196be32073a15b9b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env sh
# demo: https://www.youtube.com/watch?v=qYhNJ3itqWw
echo "W3m-control: BACK"
saving_session="$HOME/.w3m/RestoreSession.txt"
echo "W3m-control: EXTERN echo %s > $saving_session"
# loop save URL of all tabs
n=0
while [ "$n" -lt 30 ]; do
  n=$(( n + 1 ))
  echo "W3m-control: NEXT_TAB"
  echo "W3m-control: EXTERN echo %s >> $saving_session"
done
# generate a script; run 'w3mlastsession' command in terminal to restore session
echo "W3m-control: READ_SHELL ~/.w3m/cgi-bin/restore_session.cgi"
echo "W3m-control: BACK"
echo "W3m-control: QUIT"