From 6e528248414e330c9e25e81596ab47b8b8a5b701 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 14 May 2021 22:44:50 +0430 Subject: first commit --- .w3m/cgi-bin/restore_tab.cgi | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 .w3m/cgi-bin/restore_tab.cgi (limited to '.w3m/cgi-bin/restore_tab.cgi') 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"; -- cgit v1.2.3