aboutsummaryrefslogtreecommitdiffstats
path: root/.w3m/cgi-bin/restore_tab.cgi
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-05-14 18:14:50 +0000
committerterminaldweller <thabogre@gmail.com>2021-05-14 18:14:50 +0000
commit6e528248414e330c9e25e81596ab47b8b8a5b701 (patch)
treee1aa41a7f3198eeac187e6177ec7d4a33db229d3 /.w3m/cgi-bin/restore_tab.cgi
downloadscripts-master.tar.gz
scripts-master.zip
first commitmaster
Diffstat (limited to '')
-rwxr-xr-x.w3m/cgi-bin/restore_tab.cgi10
1 files changed, 10 insertions, 0 deletions
diff --git a/.w3m/cgi-bin/restore_tab.cgi b/.w3m/cgi-bin/restore_tab.cgi
new file mode 100755
index 0000000..27b3316
--- /dev/null
+++ b/.w3m/cgi-bin/restore_tab.cgi
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+
+TAB_RESTORE_LIMIT=30
+
+last_tab=$(tail -n 1 ~/.w3m/RestoreTab.txt);
+limit=$(tail -n $TAB_RESTORE_LIMIT ~/.w3m/RestoreTab.txt)
+other_tabs=$(printf "%s" "$limit" | head -n -1);
+printf "%s\r\n" "$other_tabs" > ~/.w3m/RestoreTab.txt;
+printf "%s\r\n" "W3m-control: GOTO $last_tab";
+printf "W3m-control: DELETE PREVBUF\r\n";