diff options
author | luxagraf <sng@luxagraf.net> | 2023-05-31 13:58:50 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-05-31 13:58:50 -0500 |
commit | 58ed0d4b2fd7e023e0c80f623c0103cfbd6e03d6 (patch) | |
tree | 04b603bfcc33109b9dbd08c7f60f2c77688fd889 | |
parent | b3aa94d1f0d74fecc02e82609e78e62d3b967bab (diff) |
Added scripts and config for w3m
102 files changed, 1941 insertions, 0 deletions
diff --git a/.w3m/bookmark.html b/.w3m/bookmark.html new file mode 100644 index 0000000..de08401 --- /dev/null +++ b/.w3m/bookmark.html @@ -0,0 +1,10 @@ +<html><head><title>Bookmarks</title></head> +<body> +<h1>Bookmarks</h1> +<h2>Personal</h2> +<ul> +<li><a href="https://luxagraf.net/">Luxagraf: thoughts on ecology, culture, travel, photography, walking and other ephemera</a> +<!--End of section (do not delete this comment)--> +</ul> +</body> +</html> diff --git a/.w3m/cgi-bin/dictionary.cgi b/.w3m/cgi-bin/dictionary.cgi new file mode 100755 index 0000000..3fc2234 --- /dev/null +++ b/.w3m/cgi-bin/dictionary.cgi @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# DESC: online dictionary lookup using curl +# DEMO: https://youtu.be/77qhjaoj_2k +# REQD: 1. chmod +x ~/.w3m/cgi-bin/dictionary.cgi +# 2. sed -i 's@^cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@^use_dictcommand.*@use_dictcommand 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# ############################ Execute dictionary command (DICT_WORD) +# keymap \\\d COMMAND "SET_OPTION dictcommand=file:///cgi-bin/dictionary.cgi ; DICT_WORD" +# ############################ Execute dictionary command for word at cursor (DICT_WORD_AT) +# keymap \\\w COMMAND "SET_OPTION dictcommand=file:///cgi-bin/dictionary.cgi ; DICT_WORD_AT" + + +echo "w3m-control: READ_SHELL curl -s dict://dict.org/d:$QUERY_STRING" +echo "w3m-control: DELETE_PREVBUF" +echo "w3m-control: REDRAW" diff --git a/.w3m/cgi-bin/fn_aria2p.cgi b/.w3m/cgi-bin/fn_aria2p.cgi new file mode 100755 index 0000000..820485f --- /dev/null +++ b/.w3m/cgi-bin/fn_aria2p.cgi @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# requires: aria2p (https://github.com/pawamoy/aria2p) +# EXTERN_LINK / $W3M_CURRENT_LINK = under cursor +# EXTERN / $W3M_URL = current page +echo "W3m-control: BACK" +echo "W3m-control: READ_SHELL aria2p" +echo "W3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_aria2t.cgi b/.w3m/cgi-bin/fn_aria2t.cgi new file mode 100755 index 0000000..30adafc --- /dev/null +++ b/.w3m/cgi-bin/fn_aria2t.cgi @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# requires: aria2t (https://github.com/zsugabubus/aria2t) +# EXTERN_LINK / $W3M_CURRENT_LINK = under cursor +# EXTERN / $W3M_URL = current page +echo "W3m-control: BACK" +echo "W3m-control: READ_SHELL aria2t" +echo "W3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_click_next.cgi b/.w3m/cgi-bin/fn_click_next.cgi new file mode 100755 index 0000000..5d1e0db --- /dev/null +++ b/.w3m/cgi-bin/fn_click_next.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: END" +echo "W3m-control: SEARCH_BACK next" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_click_next_arrow.cgi b/.w3m/cgi-bin/fn_click_next_arrow.cgi new file mode 100755 index 0000000..8af440c --- /dev/null +++ b/.w3m/cgi-bin/fn_click_next_arrow.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: END" +echo "W3m-control: SEARCH_BACK >" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_click_prev.cgi b/.w3m/cgi-bin/fn_click_prev.cgi new file mode 100755 index 0000000..5104f9a --- /dev/null +++ b/.w3m/cgi-bin/fn_click_prev.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: END" +echo "W3m-control: SEARCH_BACK prev" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_click_prev_arrow.cgi b/.w3m/cgi-bin/fn_click_prev_arrow.cgi new file mode 100755 index 0000000..aedeefe --- /dev/null +++ b/.w3m/cgi-bin/fn_click_prev_arrow.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: END" +echo "W3m-control: SEARCH_BACK <" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_closetab_stash.cgi b/.w3m/cgi-bin/fn_closetab_stash.cgi new file mode 100755 index 0000000..7b4c733 --- /dev/null +++ b/.w3m/cgi-bin/fn_closetab_stash.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "$W3M_URL" >> ~/.w3m/RestoreTab.txt +echo "W3m-control: CLOSE_TAB" diff --git a/.w3m/cgi-bin/fn_diana_add.cgi b/.w3m/cgi-bin/fn_diana_add.cgi new file mode 100755 index 0000000..cf080bf --- /dev/null +++ b/.w3m/cgi-bin/fn_diana_add.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +# requires: diana (https://github.com/baskerville/diana) +# EXTERN_LINK / $W3M_CURRENT_LINK = under cursor +# EXTERN / $W3M_URL = current page +echo "W3m-control: BACK" +echo "W3m-control: EXTERN_LINK diana add" diff --git a/.w3m/cgi-bin/fn_diana_addpaused.cgi b/.w3m/cgi-bin/fn_diana_addpaused.cgi new file mode 100755 index 0000000..8325ba9 --- /dev/null +++ b/.w3m/cgi-bin/fn_diana_addpaused.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +# requires: diana (https://github.com/baskerville/diana) +# EXTERN_LINK / $W3M_CURRENT_LINK = under cursor +# EXTERN / $W3M_URL = current page +echo "W3m-control: BACK" +echo "W3m-control: EXTERN_LINK diana --pause add" diff --git a/.w3m/cgi-bin/fn_dict_curl.cgi b/.w3m/cgi-bin/fn_dict_curl.cgi new file mode 100755 index 0000000..bdeca3b --- /dev/null +++ b/.w3m/cgi-bin/fn_dict_curl.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: READ_SHELL curl -s dict://dict.org/d:$W3M_CURRENT_WORD" +echo "W3m-control: DELETE_PREVBUF" +echo "W3m-control: REDRAW" diff --git a/.w3m/cgi-bin/fn_display_borders.cgi b/.w3m/cgi-bin/fn_display_borders.cgi new file mode 100755 index 0000000..1f7909a --- /dev/null +++ b/.w3m/cgi-bin/fn_display_borders.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION display_borders=toggle" +echo "W3m-control: BACK" +echo "W3m-control: RESHAPE" diff --git a/.w3m/cgi-bin/fn_display_image.cgi b/.w3m/cgi-bin/fn_display_image.cgi new file mode 100755 index 0000000..e3b60f8 --- /dev/null +++ b/.w3m/cgi-bin/fn_display_image.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION display_image=toggle" +echo "W3m-control: BACK" +echo "W3m-control: RELOAD" diff --git a/.w3m/cgi-bin/fn_display_link_number.cgi b/.w3m/cgi-bin/fn_display_link_number.cgi new file mode 100755 index 0000000..0857290 --- /dev/null +++ b/.w3m/cgi-bin/fn_display_link_number.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION display_link_number=toggle" +echo "W3m-control: BACK" +echo "W3m-control: RESHAPE" diff --git a/.w3m/cgi-bin/fn_edit_bookmark.cgi b/.w3m/cgi-bin/fn_edit_bookmark.cgi new file mode 100755 index 0000000..1c12a96 --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_bookmark.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: VIEW_BOOKMARK" +echo "W3m-control: EDIT" diff --git a/.w3m/cgi-bin/fn_edit_config.cgi b/.w3m/cgi-bin/fn_edit_config.cgi new file mode 100755 index 0000000..dba682a --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_config.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/config" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" +echo "W3m-control: REINIT" diff --git a/.w3m/cgi-bin/fn_edit_keymap.cgi b/.w3m/cgi-bin/fn_edit_keymap.cgi new file mode 100755 index 0000000..3469834 --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_keymap.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/keymap" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" +echo "W3m-control: REINIT" diff --git a/.w3m/cgi-bin/fn_edit_mailcap.cgi b/.w3m/cgi-bin/fn_edit_mailcap.cgi new file mode 100755 index 0000000..3aba71d --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_mailcap.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/mailcap" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" +echo "W3m-control: REINIT" diff --git a/.w3m/cgi-bin/fn_edit_menu.cgi b/.w3m/cgi-bin/fn_edit_menu.cgi new file mode 100755 index 0000000..6de97e0 --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_menu.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/menu" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" +echo "W3m-control: REINIT" diff --git a/.w3m/cgi-bin/fn_edit_restoretab.cgi b/.w3m/cgi-bin/fn_edit_restoretab.cgi new file mode 100755 index 0000000..33db25a --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_restoretab.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/RestoreTab.txt" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_edit_searchengine.cgi b/.w3m/cgi-bin/fn_edit_searchengine.cgi new file mode 100755 index 0000000..4588d0a --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_searchengine.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/cgi-bin/search_engines.cgi" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_edit_siteconf.cgi b/.w3m/cgi-bin/fn_edit_siteconf.cgi new file mode 100755 index 0000000..e7b2b60 --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_siteconf.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/siteconf" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" +echo "W3m-control: REINIT" diff --git a/.w3m/cgi-bin/fn_edit_surfraw.cgi b/.w3m/cgi-bin/fn_edit_surfraw.cgi new file mode 100755 index 0000000..51d9e7b --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_surfraw.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.config/surfraw/bookmarks" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_edit_urimethodmap.cgi b/.w3m/cgi-bin/fn_edit_urimethodmap.cgi new file mode 100755 index 0000000..efcace7 --- /dev/null +++ b/.w3m/cgi-bin/fn_edit_urimethodmap.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: LOAD ~/.w3m/urimethodmap" +echo "W3m-control: EDIT" +echo "W3m-control: BACK" +echo "W3m-control: REINIT" diff --git a/.w3m/cgi-bin/fn_engine_1337x.cgi b/.w3m/cgi-bin/fn_engine_1337x.cgi new file mode 100755 index 0000000..6ab3243 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_1337x.cgi @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://1337x.to/" +echo "W3m-control: GOTO_LINE 13" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: NEXT_PAGE" diff --git a/.w3m/cgi-bin/fn_engine_commandlinefu.cgi b/.w3m/cgi-bin/fn_engine_commandlinefu.cgi new file mode 100755 index 0000000..522c411 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_commandlinefu.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://www.commandlinefu.com" +echo "W3m-control: GOTO_LINE 13" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_duckduckgo.cgi b/.w3m/cgi-bin/fn_engine_duckduckgo.cgi new file mode 100755 index 0000000..849259e --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_duckduckgo.cgi @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://duckduckgo.com/lite/" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_geminispace.cgi b/.w3m/cgi-bin/fn_engine_geminispace.cgi new file mode 100755 index 0000000..4aa1666 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_geminispace.cgi @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://portal.mozz.us/gemini/geminispace.info/search" +echo "W3m-control: END" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_google.cgi b/.w3m/cgi-bin/fn_engine_google.cgi new file mode 100755 index 0000000..589fc11 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_google.cgi @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://google.com" +echo "W3m-control: GOTO_LINE 6" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_invidious.cgi b/.w3m/cgi-bin/fn_engine_invidious.cgi new file mode 100755 index 0000000..02af3e8 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_invidious.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://yewtu.be" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_nyaasi.cgi b/.w3m/cgi-bin/fn_engine_nyaasi.cgi new file mode 100755 index 0000000..dacb4b7 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_nyaasi.cgi @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://nyaa.si" +echo "W3m-control: GOTO_LINE 15" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: GOTO_LINE 18" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_piratebay.cgi b/.w3m/cgi-bin/fn_engine_piratebay.cgi new file mode 100755 index 0000000..76298b9 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_piratebay.cgi @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://thepiratebay10.org" +echo "W3m-control: GOTO_LINE 5" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: GOTO_LINE 8" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_veronica2.cgi b/.w3m/cgi-bin/fn_engine_veronica2.cgi new file mode 100755 index 0000000..b5645b2 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_veronica2.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO gopher://gopher.floodgap.com/7/v2/vs" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_wikipedia.cgi b/.w3m/cgi-bin/fn_engine_wikipedia.cgi new file mode 100755 index 0000000..b14112c --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_wikipedia.cgi @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://en.wikipedia.org/wiki/Main_Page#searchInput" +echo "W3m-control: LINE_BEGIN" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_xdcceu.cgi b/.w3m/cgi-bin/fn_engine_xdcceu.cgi new file mode 100755 index 0000000..5cd7e98 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_xdcceu.cgi @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://www.xdcc.eu/" +echo "W3m-control: GOTO_LINE 11" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_engine_yahoo.cgi b/.w3m/cgi-bin/fn_engine_yahoo.cgi new file mode 100755 index 0000000..6c95102 --- /dev/null +++ b/.w3m/cgi-bin/fn_engine_yahoo.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: TAB_GOTO https://search.yahoo.com" +echo "W3m-control: GOTO_LINE 20" +echo "W3m-control: NEXT_LINK" +echo "W3m-control: GOTO_LINK" diff --git a/.w3m/cgi-bin/fn_goto_tmux_clipboard.cgi b/.w3m/cgi-bin/fn_goto_tmux_clipboard.cgi new file mode 100755 index 0000000..e6d1a5b --- /dev/null +++ b/.w3m/cgi-bin/fn_goto_tmux_clipboard.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION default_url=0" +echo "W3m-control: GOTO $(tmux show-buffer)" +echo "W3m-control: DELETE_PREVBUF" +echo "W3m-control: SET_OPTION default_url=1" diff --git a/.w3m/cgi-bin/fn_goto_w3m_clipboard.cgi b/.w3m/cgi-bin/fn_goto_w3m_clipboard.cgi new file mode 100755 index 0000000..a46ed90 --- /dev/null +++ b/.w3m/cgi-bin/fn_goto_w3m_clipboard.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION default_url=0" +echo "W3m-control: GOTO $(cat /tmp/clipbrd.txt)" +echo "W3m-control: DELETE_PREVBUF" +echo "W3m-control: SET_OPTION default_url=1" diff --git a/.w3m/cgi-bin/fn_goto_x11_clipboard.cgi b/.w3m/cgi-bin/fn_goto_x11_clipboard.cgi new file mode 100755 index 0000000..e95eb42 --- /dev/null +++ b/.w3m/cgi-bin/fn_goto_x11_clipboard.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION default_url=0" +echo "W3m-control: GOTO $(xsel -ob)" +echo "W3m-control: DELETE_PREVBUF" +echo "W3m-control: SET_OPTION default_url=1" diff --git a/.w3m/cgi-bin/fn_open_link_in_gui_browser.cgi b/.w3m/cgi-bin/fn_open_link_in_gui_browser.cgi new file mode 100755 index 0000000..a6c1a07 --- /dev/null +++ b/.w3m/cgi-bin/fn_open_link_in_gui_browser.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +# EXTERN_LINK = under cursor +# EXTERN = current page +echo "W3m-control: BACK" +echo "W3m-control: EXTERN_LINK $BROWSER" diff --git a/.w3m/cgi-bin/fn_open_page_in_gui_browser.cgi b/.w3m/cgi-bin/fn_open_page_in_gui_browser.cgi new file mode 100755 index 0000000..b37cd74 --- /dev/null +++ b/.w3m/cgi-bin/fn_open_page_in_gui_browser.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +# EXTERN_LINK = under cursor +# EXTERN = current page +echo "W3m-control: BACK" +echo "W3m-control: EXTERN $BROWSER" diff --git a/.w3m/cgi-bin/fn_readerview_rdrview.cgi b/.w3m/cgi-bin/fn_readerview_rdrview.cgi new file mode 100755 index 0000000..af70e78 --- /dev/null +++ b/.w3m/cgi-bin/fn_readerview_rdrview.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: READ_SHELL rdrview -H $W3M_URL 2>/dev/null" +echo "W3m-control: VIEW" +echo "W3m-control: DELETE_PREVBUF" diff --git a/.w3m/cgi-bin/fn_readerview_readability.cgi b/.w3m/cgi-bin/fn_readerview_readability.cgi new file mode 100755 index 0000000..8212a1a --- /dev/null +++ b/.w3m/cgi-bin/fn_readerview_readability.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: READ_SHELL python3 -m readability.readability -u $W3M_URL 2> /dev/null" +echo "W3m-control: VIEW" +echo "W3m-control: DELETE_PREVBUF" diff --git a/.w3m/cgi-bin/fn_readerview_readable.cgi b/.w3m/cgi-bin/fn_readerview_readable.cgi new file mode 100755 index 0000000..4240339 --- /dev/null +++ b/.w3m/cgi-bin/fn_readerview_readable.cgi @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +echo "W3m-control: BACK" +echo "W3m-control: READ_SHELL readable $W3M_URL -p html-title,html-content 2>/dev/null" +echo "W3m-control: VIEW" +echo "W3m-control: DELETE_PREVBUF" + diff --git a/.w3m/cgi-bin/fn_restore_tab.cgi b/.w3m/cgi-bin/fn_restore_tab.cgi new file mode 100755 index 0000000..234adef --- /dev/null +++ b/.w3m/cgi-bin/fn_restore_tab.cgi @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +# demo: https://www.youtube.com/watch?v=e5_q3-r6PAU +echo "W3m-control: BACK" +FILE="$HOME/.w3m/RestoreTab.txt" +LAST_TAB=$(tail -n 1 "$FILE") # Open the last closed tab +LIMIT=$(tail -n 20 "$FILE") # Limit of tabs stored +OTHER_TABS=$(printf "%s" "$LIMIT" | head -n -1) +echo "$OTHER_TABS" > "$FILE" +echo "W3m-control: TAB_GOTO $LAST_TAB" +echo "W3m-control: DELETE_PREVBUF" diff --git a/.w3m/cgi-bin/fn_save_session.cgi b/.w3m/cgi-bin/fn_save_session.cgi new file mode 100755 index 0000000..fb9bd59 --- /dev/null +++ b/.w3m/cgi-bin/fn_save_session.cgi @@ -0,0 +1,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" diff --git a/.w3m/cgi-bin/fn_show_input_line_editing_mode_key_binding.cgi b/.w3m/cgi-bin/fn_show_input_line_editing_mode_key_binding.cgi new file mode 100755 index 0000000..beade54 --- /dev/null +++ b/.w3m/cgi-bin/fn_show_input_line_editing_mode_key_binding.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: HELP" +echo "W3m-control: SEARCH ^Input Line Editing Mode" +echo "W3m-control: CENTER_V" +echo "W3m-control: DELETE_PREVBUF" diff --git a/.w3m/cgi-bin/fn_show_user_defined_key_binding.cgi b/.w3m/cgi-bin/fn_show_user_defined_key_binding.cgi new file mode 100755 index 0000000..8f15c8c --- /dev/null +++ b/.w3m/cgi-bin/fn_show_user_defined_key_binding.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +echo "W3m-control: HELP" +echo "W3m-control: SEARCH ^User-Defined" +echo "W3m-control: CENTER_V" +echo "W3m-control: DELETE_PREVBUF" diff --git a/.w3m/cgi-bin/fn_toggle_color.cgi b/.w3m/cgi-bin/fn_toggle_color.cgi new file mode 100755 index 0000000..5de2911 --- /dev/null +++ b/.w3m/cgi-bin/fn_toggle_color.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION color=toggle" +echo "W3m-control: BACK" +echo "W3m-control: RESHAPE" diff --git a/.w3m/cgi-bin/fn_toggle_line_number.cgi b/.w3m/cgi-bin/fn_toggle_line_number.cgi new file mode 100755 index 0000000..1deef8b --- /dev/null +++ b/.w3m/cgi-bin/fn_toggle_line_number.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION show_lnum=toggle" +echo "W3m-control: BACK" +echo "W3m-control: RESHAPE" diff --git a/.w3m/cgi-bin/fn_treat_url_like_strings.cgi b/.w3m/cgi-bin/fn_treat_url_like_strings.cgi new file mode 100755 index 0000000..5d338d1 --- /dev/null +++ b/.w3m/cgi-bin/fn_treat_url_like_strings.cgi @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +# Treat URL-like strings as links in all pages (convert text to url) +echo "W3m-control: SET_OPTION mark_all_pages=toggle" +echo "W3m-control: BACK" +echo "W3m-control: RELOAD" diff --git a/.w3m/cgi-bin/fn_tts_espeak_page.cgi b/.w3m/cgi-bin/fn_tts_espeak_page.cgi new file mode 100755 index 0000000..72c390a --- /dev/null +++ b/.w3m/cgi-bin/fn_tts_espeak_page.cgi @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL killall espeak-ng" +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL rm /tmp/espeak-ng.txt" +echo "w3m-control: BACK" +echo "w3m-control: PRINT /tmp/espeak-ng.txt" +echo "w3m-control: READ_SHELL espeak-ng -f /tmp/espeak-ng.txt &" +echo "w3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_tts_espeak_word.cgi b/.w3m/cgi-bin/fn_tts_espeak_word.cgi new file mode 100755 index 0000000..8a85c43 --- /dev/null +++ b/.w3m/cgi-bin/fn_tts_espeak_word.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL espeak-ng $W3M_CURRENT_WORD &" +echo "w3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_tts_festival_page.cgi b/.w3m/cgi-bin/fn_tts_festival_page.cgi new file mode 100755 index 0000000..0e1c37a --- /dev/null +++ b/.w3m/cgi-bin/fn_tts_festival_page.cgi @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL killall festival" +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL rm /tmp/festival.txt" +echo "w3m-control: BACK" +echo "w3m-control: PRINT /tmp/festival.txt" +echo "w3m-control: READ_SHELL festival --tts /tmp/festival.txt &" +echo "w3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_tts_festival_word.cgi b/.w3m/cgi-bin/fn_tts_festival_word.cgi new file mode 100755 index 0000000..ca348b6 --- /dev/null +++ b/.w3m/cgi-bin/fn_tts_festival_word.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL (echo $W3M_CURRENT_WORD | festival --tts) &" +echo "w3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_tts_kill.cgi b/.w3m/cgi-bin/fn_tts_kill.cgi new file mode 100755 index 0000000..886d37b --- /dev/null +++ b/.w3m/cgi-bin/fn_tts_kill.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL (killall espeak-ng ; killall festival; killall picospeaker)" +echo "w3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_tts_svoxpico_page.cgi b/.w3m/cgi-bin/fn_tts_svoxpico_page.cgi new file mode 100755 index 0000000..9203527 --- /dev/null +++ b/.w3m/cgi-bin/fn_tts_svoxpico_page.cgi @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL killall picospeaker" +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL rm /tmp/picospeaker.txt" +echo "w3m-control: BACK" +echo "w3m-control: PRINT /tmp/picospeaker.txt" +echo "w3m-control: READ_SHELL picospeaker < /tmp/picospeaker.txt 2>/dev/null &" +echo "w3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_tts_svoxpico_word.cgi b/.w3m/cgi-bin/fn_tts_svoxpico_word.cgi new file mode 100755 index 0000000..7f790eb --- /dev/null +++ b/.w3m/cgi-bin/fn_tts_svoxpico_word.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: READ_SHELL picospeaker $W3M_CURRENT_WORD &" +echo "w3m-control: BACK" diff --git a/.w3m/cgi-bin/fn_user_agent_clear.cgi b/.w3m/cgi-bin/fn_user_agent_clear.cgi new file mode 100755 index 0000000..3fb6096 --- /dev/null +++ b/.w3m/cgi-bin/fn_user_agent_clear.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION user_agent=" +echo "W3m-control: BACK" +echo "W3m-control: RELOAD" diff --git a/.w3m/cgi-bin/fn_user_agent_set.cgi b/.w3m/cgi-bin/fn_user_agent_set.cgi new file mode 100755 index 0000000..3e54c38 --- /dev/null +++ b/.w3m/cgi-bin/fn_user_agent_set.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "W3m-control: SET_OPTION user_agent=Opera/9.80 (S60; SymbOS; Opera Mobi/SYB-1107071606; U; en) Presto/2.8.149 Version/11.10" +echo "W3m-control: BACK" +echo "W3m-control: RELOAD" diff --git a/.w3m/cgi-bin/fn_yank_current_link.cgi b/.w3m/cgi-bin/fn_yank_current_link.cgi new file mode 100755 index 0000000..412af56 --- /dev/null +++ b/.w3m/cgi-bin/fn_yank_current_link.cgi @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +# EXTERN_LINK / $W3M_CURRENT_LINK = under cursor +# EXTERN / $W3M_URL = current page +echo "W3m-control: BACK" +url="$W3M_CURRENT_LINK" +printf "%b" "$url" > /tmp/clipbrd.txt +printf "%b" "$url" | xsel -b 2>/dev/null +printf "%b" "$url" | tmux load-buffer - +printf '%b' "$url" | wl-copy 2>/dev/null +printf '%b' "$url" | clip 2>/dev/null +printf '%b' "$url" > /dev/clipboard 2>/dev/null +printf '%b' "$url" | pbcopy 2>/dev/null +printf '%b' "$url" | termux-clipboard-set 2>/dev/null diff --git a/.w3m/cgi-bin/fn_yank_page_url.cgi b/.w3m/cgi-bin/fn_yank_page_url.cgi new file mode 100755 index 0000000..6d8e576 --- /dev/null +++ b/.w3m/cgi-bin/fn_yank_page_url.cgi @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +# EXTERN_LINK / $W3M_CURRENT_LINK = under cursor +# EXTERN / $W3M_URL = current page +echo "W3m-control: BACK" +url="$W3M_URL" +printf "%b" "$url" > /tmp/clipbrd.txt +printf "%b" "$url" | xsel -b 2>/dev/null +printf "%b" "$url" | tmux load-buffer - +printf '%b' "$url" | wl-copy 2>/dev/null +printf '%b' "$url" | clip 2>/dev/null +printf '%b' "$url" > /dev/clipboard 2>/dev/null +printf '%b' "$url" | pbcopy 2>/dev/null +printf '%b' "$url" | termux-clipboard-set 2>/dev/null diff --git a/.w3m/cgi-bin/fnx_execute.cgi b/.w3m/cgi-bin/fnx_execute.cgi new file mode 100755 index 0000000..837b990 --- /dev/null +++ b/.w3m/cgi-bin/fnx_execute.cgi @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +w3m_fnx_clipboard="$(cat /tmp/w3m_fnx_clipboard.txt)" +case "$w3m_fnx_clipboard" in + *.cgi) echo "W3m-control: GOTO file:/cgi-bin/$w3m_fnx_clipboard" ;; + http://*|https://*|www.*|gopher://*|gemini://*) echo "W3m-control: TAB_GOTO $w3m_fnx_clipboard" ;; + /*|\~/*) echo "W3m-control: TAB_GOTO $w3m_fnx_clipboard" ;; + *) echo "W3m-control: $w3m_fnx_clipboard" ;; +esac diff --git a/.w3m/cgi-bin/fnx_execute.cgi_ b/.w3m/cgi-bin/fnx_execute.cgi_ new file mode 100755 index 0000000..837b990 --- /dev/null +++ b/.w3m/cgi-bin/fnx_execute.cgi_ @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +w3m_fnx_clipboard="$(cat /tmp/w3m_fnx_clipboard.txt)" +case "$w3m_fnx_clipboard" in + *.cgi) echo "W3m-control: GOTO file:/cgi-bin/$w3m_fnx_clipboard" ;; + http://*|https://*|www.*|gopher://*|gemini://*) echo "W3m-control: TAB_GOTO $w3m_fnx_clipboard" ;; + /*|\~/*) echo "W3m-control: TAB_GOTO $w3m_fnx_clipboard" ;; + *) echo "W3m-control: $w3m_fnx_clipboard" ;; +esac diff --git a/.w3m/cgi-bin/fnx_fzfmiru.cgi b/.w3m/cgi-bin/fnx_fzfmiru.cgi new file mode 100755 index 0000000..9ec3486 --- /dev/null +++ b/.w3m/cgi-bin/fnx_fzfmiru.cgi @@ -0,0 +1,292 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: execute w3m commands via fzf +# DEMO: https://youtu.be/drzMQuLE4BM +# DEPEND: fzf gawk coreutils +# REFF: inspired by NapoleonWils0n https://www.youtube.com/watch?v=dyXcYxZOa9M +# REQD: 1. chmod +x ~/.w3m/cgi-bin/fnx_fzfmiru.cgi +# 2. chmod +x ~/.w3m/cgi-bin/fnx_execute.cgi +# 3. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# keymap xx COMMAND "READ_SHELL ~/.w3m/cgi-bin/fnx_fzfmiru.cgi ; BACK ; GOTO file:/cgi-bin/fnx_execute.cgi ; BACK" + +# CLOG: +# 2021-08-02 tmux if statement for popup/split/no terminal + +fnx_database() { +# $ = built-in functions ; & = custom ; * = favorites +cat <<EOF +ABORT#@ABORT\$#-- Quit at once +ACCESSKEY#@ACCESSKEY\$#-- Pop up accesskey menu +ADD_BOOKMARK#@ADD_BOOKMARK\$#-- Add current page to bookmarks +ALARM#@ALARM\$#-- Set alarm +BACK#@BACK\$#-- Close current buffer and return to the one below in stack +BEGIN#@BEGIN\$#-- Go to the first line +BOOKMARK#@BOOKMARK\$#-- View bookmarks +CENTER_H#@CENTER_H\$#-- Center on cursor column +CENTER_V#@CENTER_V\$#-- Center on cursor line +CHARSET#@CHARSET\$#-- Change the character encoding for the current document +CLOSE_TAB#@CLOSE_TAB\$#-- Close tab +CLOSE_TAB_MOUSE#@CLOSE_TAB_MOUSE\$#-- Close tab at mouse pointer +COMMAND#@COMMAND\$#-- Invoke w3m function(s) +COOKIE#@COOKIE\$#-- View cookie list +CURSOR_TOP#@CURSOR_TOP\$#-- Move cursor to the top line on the screen +CURSOR_MIDDLE#@CURSOR_MIDDLE\$#-- Move cursor to the middle line on the screen +CURSOR_BOTTOM#@CURSOR_BOTTOM\$#-- Move cursor to the bottom line on the screen +DEFAULT_CHARSET#@DEFAULT_CHARSET\$#-- Change the default character encoding +DEFINE_KEY#@DEFINE_KEY\$#-- Define a binding between a key stroke combination and a command +DELETE_PREVBUF#@DELETE_PREVBUF\$#-- Delete previous buffer (mainly for local CGI-scripts) +DICT_WORD#@DICT_WORD\$#-- Execute dictionary command (see README.dict) +DICT_WORD_AT#@DICT_WORD_AT\$#-- Execute dictionary command for word at cursor +DISPLAY_IMAGE#@DISPLAY_IMAGE\$#-- Restart loading and drawing of images +DOWN#@DOWN\$#-- Scroll the screen down one line +DOWNLOAD#@DOWNLOAD\$#-- Save document source +DOWNLOAD_LIST#@DOWNLOAD_LIST\$#-- Display downloads panel +EDIT#@EDIT\$#-- Edit local source +EDIT_SCREEN#@EDIT_SCREEN\$#-- Edit rendered copy of document +END#@END\$#-- Go to the last line +EXEC_SHELL#@EXEC_SHELL\$#-- Execute shell command and display output +EXIT#@EXIT\$#-- Quit at once +EXTERN#@EXTERN\$#-- Display using an external browser +EXTERN_LINK#@EXTERN_LINK\$#-- Display target using an external browser +FRAME#@FRAME\$#-- Toggle rendering HTML frames +GOTO#@GOTO\$*#-- Open specified document in a new buffer +GOTO_HOME#@GOTO_HOME\$#-- Return to the homepage (specified HTTP_HOME or WWW_HOME variable) +GOTO_LINE#@GOTO_LINE\$#-- Go to the specified line +GOTO_LINK#@GOTO_LINK\$#-- Follow current hyperlink in a new buffer +GOTO_RELATIVE#@GOTO_RELATIVE\$#-- Go to relative address +HELP#@HELP\$#-- Show help panel +HISTORY#@HISTORY\$#-- Show browsing history +INFO#@INFO\$#-- Display information about the current document +INTERRUPT#@INTERRUPT\$#-- Suspend w3m to background +ISEARCH#@ISEARCH\$#-- Incremental search forward +ISEARCH_BACK#@ISEARCH_BACK\$#-- Incremental search backward +LEFT#@LEFT\$#-- Shift screen one column left +LINE_BEGIN#@LINE_BEGIN\$#-- Go to the beginning of the line +LINE_END#@LINE_END\$#-- Go to the end of the line +LINE_INFO#@LINE_INFO\$#-- Display current position in document +LINK_BEGIN#@LINK_BEGIN\$#-- Move to the first hyperlink +LINK_END#@LINK_END\$#-- Move to the last hyperlink +LINK_MENU#@LINK_MENU\$#-- Pop up link element menu +LIST#@LIST\$*#-- Show all URLs referenced +LIST_MENU#@LIST_MENU\$#-- Pop up menu for hyperlinks to browse to +LOAD#@LOAD\$#-- Open local file in a new buffer +MAIN_MENU#@MAIN_MENU\$#-- Pop up menu +MARK#@MARK\$#-- Set/unset mark +MARK_MID#@MARK_MID\$#-- Turn Message-ID-like strings into hyperlinks +MARK_URL#@MARK_URL\$#-- Turn URL-like strings into hyperlinks +MARK_WORD#@MARK_WORD\$#-- Turn current word into hyperlink +MENU#@MENU\$#-- Pop up menu +MENU_MOUSE#@MENU_MOUSE\$#-- Pop up menu at mouse pointer +MOUSE_TOGGLE#@MOUSE_TOGGLE\$#-- Toggle mouse support +MOVE_DOWN#@MOVE_DOWN\$#-- Cursor down +MOVE_DOWN1#@MOVE_DOWN1\$#-- Cursor down. With edge touched, slide +MOVE_LEFT#@MOVE_LEFT\$#-- Cursor left +MOVE_LEFT1#@MOVE_LEFT1\$#-- Cursor left. With edge touched, slide +MOVE_LIST_MENU#@MOVE_LIST_MENU\$*#-- Pop up menu to navigate between hyperlinks +MOVE_MOUSE#@MOVE_MOUSE\$#-- Move cursor to mouse pointer +MOVE_RIGHT#@MOVE_RIGHT\$#-- Cursor right +MOVE_RIGHT1#@MOVE_RIGHT1\$#-- Cursor right. With edge touched, slide +MOVE_UP#@MOVE_UP\$#-- Cursor up +MOVE_UP1#@MOVE_UP1\$#-- Cursor up. With edge touched, slide +MSGS#@MSGS\$#-- Display error messages +NEW_TAB#@NEW_TAB\$#-- Open a new tab (with current document) +NEXT#@NEXT\$#-- Switch to the next buffer +NEXT_DOWN#@NEXT_DOWN\$#-- Move downward to the next hyperlink +NEXT_HALF_PAGE#@NEXT_HALF_PAGE\$#-- Scroll down half a page +NEXT_LEFT#@NEXT_LEFT\$#-- Move left to the next hyperlink +NEXT_LEFT_UP#@NEXT_LEFT_UP\$#-- Move left or upward to the next hyperlink +NEXT_LINK#@NEXT_LINK\$#-- Move to the next hyperlink +NEXT_MARK#@NEXT_MARK\$#-- Go to the next mark +NEXT_PAGE#@NEXT_PAGE\$#-- Scroll down one page +NEXT_RIGHT#@NEXT_RIGHT\$#-- Move right to the next hyperlink +NEXT_RIGHT_DOWN#@NEXT_RIGHT_DOWN\$#-- Move right or downward to the next hyperlink +NEXT_TAB#@NEXT_TAB\$#-- Switch to the next tab +NEXT_UP#@NEXT_UP\$#-- Move upward to the next hyperlink +NEXT_VISITED#@NEXT_VISITED\$#-- Move to the next visited hyperlink +NEXT_WORD#@NEXT_WORD\$#-- Move to the next word +NOTHING#@NOTHING\$#-- Do nothing +NULL#@NULL\$#-- Do nothing +OPTIONS#@OPTIONS\$#-- Display options setting panel +PEEK#@PEEK\$#-- Show current address +PEEK_IMG#@PEEK_IMG\$#-- Show image address +PEEK_LINK#@PEEK_LINK\$#-- Show target address +PIPE_BUF#@PIPE_BUF\$#-- Pipe current buffer through a shell command and display output +PIPE_SHELL#@PIPE_SHELL\$#-- Execute shell command and display output +PREV#@PREV\$#-- Switch to the previous buffer +PREV_HALF_PAGE#@PREV_HALF_PAGE\$#-- Scroll up half a page +PREV_LINK#@PREV_LINK\$#-- Move to the previous hyperlink +PREV_MARK#@PREV_MARK\$#-- Go to the previous mark +PREV_PAGE#@PREV_PAGE\$#-- Scroll up one page +PREV_TAB#@PREV_TAB\$#-- Switch to the previous tab +PREV_VISITED#@PREV_VISITED\$#-- Move to the previous visited hyperlink +PREV_WORD#@PREV_WORD\$#-- Move to the previous word +PRINT#@PRINT\$#-- Save rendered document +QUIT#@QUIT\$#-- Quit with confirmation request +READ_SHELL#@READ_SHELL\$#-- Execute shell command and display output +REDO#@REDO\$#-- Cancel the last undo +REDRAW#@REDRAW\$#-- Draw the screen anew +REG_MARK#@REG_MARK\$#-- Mark all occurences of a pattern +REINIT#@REINIT\$#-- Reload configuration file +RELOAD#@RELOAD\$#-- Load current document anew +RESHAPE#@RESHAPE\$#-- Re-render document +RIGHT#@RIGHT\$#-- Shift screen one column right +SAVE#@SAVE\$#-- Save document source +SAVE_IMAGE#@SAVE_IMAGE\$#-- Save inline image +SAVE_LINK#@SAVE_LINK\$#-- Save hyperlink target +SAVE_SCREEN#@SAVE_SCREEN\$#-- Save rendered document +SEARCH#@SEARCH\$#-- Search forward +SEARCH_BACK#@SEARCH_BACK\$#-- Search backward +SEARCH_FORE#@SEARCH_FORE\$#-- Search forward +SEARCH_NEXT#@SEARCH_NEXT\$#-- Continue search forward +SEARCH_PREV#@SEARCH_PREV\$#-- Continue search backward +SELECT#@SELECT\$#-- Display buffer-stack panel +SELECT_MENU#@SELECT_MENU\$*#-- Pop up buffer-stack menu +SETENV#@SETENV\$#-- Set environment variable +SET_OPTION#@SET_OPTION\$#-- Set option +SHELL#@SHELL\$#-- Execute shell command and display output +SHIFT_LEFT#@SHIFT_LEFT\$#-- Shift screen left +SHIFT_RIGHT#@SHIFT_RIGHT\$#-- Shift screen right +SOURCE#@SOURCE\$#-- Toggle between HTML shown or processed +STOP_IMAGE#@STOP_IMAGE\$#-- Stop loading and drawing of images +SUBMIT#@SUBMIT\$#-- Submit form +SUSPEND#@SUSPEND\$#-- Suspend w3m to background +TAB_GOTO#@TAB_GOTO\$*#-- Open specified document in a new tab +TAB_GOTO_RELATIVE#@TAB_GOTO_RELATIVE\$#-- Open relative address in a new tab +TAB_LEFT#@TAB_LEFT\$#-- Move left along the tab bar +TAB_LINK#@TAB_LINK\$#-- Follow current hyperlink in a new tab +TAB_MENU#@TAB_MENU\$*#-- Pop up tab selection menu +TAB_MOUSE#@TAB_MOUSE\$#-- Select tab by mouse action +TAB_RIGHT#@TAB_RIGHT\$#-- Move right along the tab bar +UNDO#@UNDO\$#-- Cancel the last cursor movement +UP#@UP\$#-- Scroll the screen up one line +VERSION#@VERSION\$#-- Display the version of w3m +VIEW#@VIEW\$#-- Toggle between HTML shown or processed +VIEW_BOOKMARK#@VIEW_BOOKMARK\$#-- View bookmarks +VIEW_IMAGE#@VIEW_IMAGE\$#-- Display image in viewer +WHEREIS#@WHEREIS\$#-- Search forward +WRAP_TOGGLE#@WRAP_TOGGLE\$#-- Toggle wrapping mode in searches +/usr/share/doc/w3m/README#@README_INTRO&#-- Readme intro page +/usr/share/doc/w3m/README.cookie#@README_COOKIE&#-- Readme cookie page +/usr/share/doc/w3m/README.cygwin#@README_CYGWIN&#-- Readme cygwin page +/usr/share/doc/w3m/README.dict#@README_DICT&#-- Readme dictionary page +/usr/share/doc/w3m/README.func#@README_FUNC&#-- Readme function page +/usr/share/doc/w3m/README.img#@README_IMG&#-- Readme inline image page +/usr/share/doc/w3m/README.m17n#@README_M17N&#-- Readme muntilingualizaion page +/usr/share/doc/w3m/README.mouse#@README_MOUSE&#-- Readme mouse page +/usr/share/doc/w3m/README.passwd#@README_PASSWD&#-- Readme password page +/usr/share/doc/w3m/README.pre_form#@README_PRE_FORM&#-- Readme pre-fill form page +/usr/share/doc/w3m/README.siteconf#@README_SITECONF&#-- Readme siteconf page +/usr/share/doc/w3m/README.sixel#@README_SIXEL&#-- Readme sixel image page +/usr/share/doc/w3m/README.tab#@README_TAB&#-- Readme tab browsing page +/usr/share/doc/w3m/FAQ.html#@README_FAQ&#-- Readme FAQ page +/usr/share/doc/w3m/MANUAL.html#@README_MANUAL&#-- Readme manual page +/usr/share/doc/w3m/STORY.html#@README_STORY&#-- Readme story history of W3M page +fn_click_next.cgi#@CLICK_NEXT&#-- Click next page button 'Next' +fn_click_prev.cgi#@CLICK_PREV&#-- Click previous page button 'Previous' +fn_click_next_arrow.cgi#@CLICK_NEXT_ARROW&#-- Click next page button '>' +fn_click_prev_arrow.cgi#@CLICK_PREV_ARROW&#-- Click previous page button '<' +fn_closetab_stash.cgi#@CLOSE_TAB_STASH&#-- Close tab (Stash URL to ~/.w3m/RestoreTab.txt) +fn_dict_curl.cgi#@DICT_WORD_CURL&#-- Online dictionary for word at cursor +fn_display_borders.cgi#@BORDERS&#-- Toggle table boarders +fn_display_image.cgi#@DISPLAY_IMAGE_TOGGLE&#-- Toggle display image +fn_display_link_number.cgi#@LINK_NUMBER&#-- Toggle link number (hinting mode e.g press 3[ to jump to link 3) +fn_edit_bookmark.cgi#@EDIT_BOOKMARK&#-- Edit bookmark +fn_edit_config.cgi#@EDIT_CONFIG&#-- Edit W3M configuration +fn_edit_keymap.cgi#@EDIT_KEYMAP&#-- Edit W3M keymap +fn_edit_mailcap.cgi#@EDIT_MAILCAP&#-- Edit W3M mailcap +fn_edit_menu.cgi#@EDIT_MENU&#-- Edit W3M context menu +fn_edit_restoretab.cgi#@EDIT_RESTORETAB&#-- Edit W3M restoretab ~/.w3m/RestoreTab.txt +fn_edit_searchengine.cgi#@EDIT_SEARCHENGINES&#-- Edit search engine alias ~/.w3m/cgi-bin/search_engines.cgi +fn_edit_siteconf.cgi#@EDIT_SITECONF&#-- Edit W3M siteconf +fn_edit_surfraw.cgi#@EDIT_SURFRAW&#-- Edit surfraw bookmark ~/.surfraw/bookmark +fn_edit_urimethodmap.cgi#@EDIT_URIMETHODMAP&#-- Edit W3M urimethodmap +fn_engine_duckduckgo.cgi#@ENGE_DDG&*#-- Search the web via duckduckgo +fn_engine_geminispace.cgi#@ENGE_GEMSPC&#-- Search gemini capsules via geminispace +fn_engine_google.cgi#@ENGE_GOOGLE&*#-- Search the web via google +fn_engine_invidious.cgi#@ENGE_INVIDIOUS&#-- Search youtube videos via invidious +fn_engine_1337x.cgi#@ENGE_1337X&*#-- Search 1337x for torrents +fn_engine_piratebay.cgi#@ENGE_TPB&*#-- Search piratebay for torrents +fn_engine_nyaasi.cgi#@ENGE_NYAASI&#-- Search nyaa for anime torrents +fn_engine_xdcceu.cgi#@ENGE_XDCCEU&*#-- Search xdcceu for xdcc (irc dcc files) +fn_engine_veronica2.cgi#@ENGE_V2&#-- Search gopherspace via veronica-2 +fn_engine_wikipedia.cgi#@ENGE_WIKIPEDIA&#-- Search wikipedia for articles +fn_engine_yahoo.cgi#@ENGE_YAHOO&#-- Search the web via yahoo +fn_engine_commandlinefu.cgi#@ENGE_CMDFU&#-- Search for commandline one liners via commandlinefu +fn_goto_tmux_clipboard.cgi#@GOTO_CLIP_TMUX&&#-- Paste URL and go (via tmux clipboard) +fn_goto_w3m_clipboard.cgi#@GOTO_CLIP_W3M&#-- Paste URL and go (via W3M clipboard /tmp/clipbrd.txt) +fn_goto_x11_clipboard.cgi#@GOTO_CLIP_X11&#-- Paste URL and go (via xsel X11 clipboard) +fn_open_link_in_gui_browser.cgi#@GUI_BROWSER_LINK&#-- Open link at cursor in external browser ($BROWSER) +fn_open_page_in_gui_browser.cgi#@GUI_BROWSER_URL&#-- Open page URL in external browser ($BROWSER) +fn_readerview_rdrview.cgi#@RDRVIEW_RDRVIEW&*#-- Reader view using rdrview (c/c++) +fn_readerview_readable.cgi#@RDRVIEW_READABLE&#-- Reader view using readability-cli (nodejs) +fn_readerview_readability.cgi#@RDRVIEW_READABILITY&#-- Reader view using python-readability-lxml (python3) +fn_restore_tab.cgi#@RESTORE_TAB&#-- Restore tab from ~/.w3m/RestoreTab.txt +fn_show_input_line_editing_mode_key_binding.cgi#@LIST_EDIT_MODE_KEY&#-- Show input editing mode key binding +fn_show_user_defined_key_binding.cgi#@LIST_DEFINED_KEY&*#-- Show user custom key binding +fn_toggle_color.cgi#@COLOR&#-- Toggle color +fn_toggle_line_number.cgi#@LINE_NUMBER&*#-- Toggle line number +fn_treat_url_like_strings.cgi#@TREAT_URL&*#-- Toggle plain text to clickable link +fn_user_agent_clear.cgi#@USER_AGENT_CLEAR&#-- Clear user agent string +fn_user_agent_set.cgi#@USER_AGENT_SET&#-- Set user agent string +fn_yank_current_link.cgi#@YANK_LINK&*#-- Copy link at cursor to clipboard +fn_yank_page_url.cgi#@YANK_URL&*#-- Copy page URL to clipboard +fn_save_session.cgi#@SAVE_SESSION&*#-- Save session and ask to quit (run 'w3mlastsession' command to restore) +fn_tts_espeak_page.cgi#@TTS_ESPEAK_PAGE&*#-- Espeak-ng text to speech whole page (Press Ctrl+C to continue browsing) +fn_tts_espeak_word.cgi#@TTS_ESPEAK_WORD&#-- Espeak-ng text to speech single word +fn_tts_festival_page.cgi#@TTS_FESTIVAL_PAGE&#-- Festival text to speech whole page (Press Ctrl+C to continue browsing) +fn_tts_festival_word.cgi#@TTS_FESTIVAL_WORD&#-- Festival text to speech single word +fn_tts_svoxpico_page.cgi#@TTS_SVOXPICO_PAGE&#-- SVOX Pico text to speech whole page (Press Ctrl+C to continue browsing) +fn_tts_svoxpico_word.cgi#@TTS_SVOXPICO_WORD&#-- SVOX Pico text to speech single word +fn_tts_kill.cgi#@TTS_KILL&*#-- Killall text to speech playback in progress +fn_diana_add.cgi#@DIANA_ADD&*#-- Add to aria2 daemon for downloading +fn_diana_addpaused.cgi#@DIANA_ADDPAUSED&*#-- Add to aria2 daemon for downloading (paused state) +fn_aria2p.cgi#@TUI_ARIA2P&#-- Aria2p TUI aria2 daemon download manager (python3) +fn_aria2t.cgi#@TUI_ARIA2T&#-- Aria2t TUI aria2 daemon download manager (c/c++) +http://wttr.in#@WWW_WTTR&#-- Check weather forecast +https://text.npr.org#@WWW_NPR&#-- NPR latest news +http://lite.cnn.io/en#@WWW_CNN&#-- Breaking news +http://68k.news/#@WWW_68k&#-- Headlines from the future +https://news.ycombinator.com#@WWW_HN&#-- Hacker news +https://thepiratebay10.org/top/all#@WWW_TPB&#-- Piratebay top 100 torrents +https://1337x.to/top-100#@WWW_1337X&#-- 1337x top 100 torrents +https://raw.githubusercontent.com/tats/w3m/master/ChangeLog#@WWW_W3MCLOG&#-- W3M updated changelog +https://github.com/tats/w3m/issues#@WWW_W3MISSUE&#-- W3M open issue +https://www.reddit.com/r/w3m/.mobile#@WWW_W3M&#-- W3M subreddit +https://www.reddit.com/r/commandline/.mobile#@WWW_CLI&#-- Commandline subreddit +https://www.reddit.com/r/linux/.mobile#@WWW_GNU&#-- GNU/Linux subreddit +gopher://bitreich.org/1/lawn#@WWW_LAWN&#-- Gopher list of popular gopherhole +~/Downloads#@DIR_DL&#-- Open ~/Downloads directory +/media#@DIR_MEDIA&#-- Open /media directory +EOF +} + +# clear screen +printf "\033c" + +w3m_fnx_clipboard=/tmp/w3m_fnx_clipboard.txt + +# not running tmux +if [ "$TMUX_PANE" = "%0" ] || [ -z "$TMUX" ] || [ -z "$TERM_PROGRAM" ] ; then + selection="$( fnx_database | sort -t '@' -k2 | column -t -s '#' | \ + fzf -i -e --delimiter '@' --with-nth 2.. --prompt='fzf-miru [$func|&custom|*fav] (run a W3M command): ' \ + --info=default --layout=reverse --tiebreak=index | \ + awk '{print $1}' )" + [ -z "$selection" ] && echo "" > "$w3m_fnx_clipboard" && exit +# tmux -ge 3.2 popup +elif [ "$TERM_PROGRAM" = tmux ] ; then + selection="$( fnx_database | sort -t '@' -k2 | column -t -s '#' | \ + fzf-tmux -p -w 80% -h 70% -i -e --delimiter '@' --with-nth 2.. --prompt='fzf-miru [$func|&custom|*fav] (run a W3M command): ' \ + --info=default --layout=reverse --tiebreak=index | \ + awk '{print $1}' )" + [ -z "$selection" ] && echo "" > "$w3m_fnx_clipboard" && exit +# tmux -lt 3.2 regular split +elif [ -n "$TMUX" ] ; then + selection="$( fnx_database | sort -t '@' -k2 | column -t -s '#' | \ + fzf-tmux -i -e --delimiter '@' --with-nth 2.. --prompt='fzf-miru [$func|&custom|*fav] (run a W3M command): ' \ + --info=default --layout=reverse --tiebreak=index | + awk '{print $1}' )" + [ -z "$selection" ] && echo "" > "$w3m_fnx_clipboard" && exit +fi +echo "$selection" > "$w3m_fnx_clipboard" diff --git a/.w3m/cgi-bin/fnx_fzfmiru.cgi_ b/.w3m/cgi-bin/fnx_fzfmiru.cgi_ new file mode 100755 index 0000000..9ec3486 --- /dev/null +++ b/.w3m/cgi-bin/fnx_fzfmiru.cgi_ @@ -0,0 +1,292 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: execute w3m commands via fzf +# DEMO: https://youtu.be/drzMQuLE4BM +# DEPEND: fzf gawk coreutils +# REFF: inspired by NapoleonWils0n https://www.youtube.com/watch?v=dyXcYxZOa9M +# REQD: 1. chmod +x ~/.w3m/cgi-bin/fnx_fzfmiru.cgi +# 2. chmod +x ~/.w3m/cgi-bin/fnx_execute.cgi +# 3. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# keymap xx COMMAND "READ_SHELL ~/.w3m/cgi-bin/fnx_fzfmiru.cgi ; BACK ; GOTO file:/cgi-bin/fnx_execute.cgi ; BACK" + +# CLOG: +# 2021-08-02 tmux if statement for popup/split/no terminal + +fnx_database() { +# $ = built-in functions ; & = custom ; * = favorites +cat <<EOF +ABORT#@ABORT\$#-- Quit at once +ACCESSKEY#@ACCESSKEY\$#-- Pop up accesskey menu +ADD_BOOKMARK#@ADD_BOOKMARK\$#-- Add current page to bookmarks +ALARM#@ALARM\$#-- Set alarm +BACK#@BACK\$#-- Close current buffer and return to the one below in stack +BEGIN#@BEGIN\$#-- Go to the first line +BOOKMARK#@BOOKMARK\$#-- View bookmarks +CENTER_H#@CENTER_H\$#-- Center on cursor column +CENTER_V#@CENTER_V\$#-- Center on cursor line +CHARSET#@CHARSET\$#-- Change the character encoding for the current document +CLOSE_TAB#@CLOSE_TAB\$#-- Close tab +CLOSE_TAB_MOUSE#@CLOSE_TAB_MOUSE\$#-- Close tab at mouse pointer +COMMAND#@COMMAND\$#-- Invoke w3m function(s) +COOKIE#@COOKIE\$#-- View cookie list +CURSOR_TOP#@CURSOR_TOP\$#-- Move cursor to the top line on the screen +CURSOR_MIDDLE#@CURSOR_MIDDLE\$#-- Move cursor to the middle line on the screen +CURSOR_BOTTOM#@CURSOR_BOTTOM\$#-- Move cursor to the bottom line on the screen +DEFAULT_CHARSET#@DEFAULT_CHARSET\$#-- Change the default character encoding +DEFINE_KEY#@DEFINE_KEY\$#-- Define a binding between a key stroke combination and a command +DELETE_PREVBUF#@DELETE_PREVBUF\$#-- Delete previous buffer (mainly for local CGI-scripts) +DICT_WORD#@DICT_WORD\$#-- Execute dictionary command (see README.dict) +DICT_WORD_AT#@DICT_WORD_AT\$#-- Execute dictionary command for word at cursor +DISPLAY_IMAGE#@DISPLAY_IMAGE\$#-- Restart loading and drawing of images +DOWN#@DOWN\$#-- Scroll the screen down one line +DOWNLOAD#@DOWNLOAD\$#-- Save document source +DOWNLOAD_LIST#@DOWNLOAD_LIST\$#-- Display downloads panel +EDIT#@EDIT\$#-- Edit local source +EDIT_SCREEN#@EDIT_SCREEN\$#-- Edit rendered copy of document +END#@END\$#-- Go to the last line +EXEC_SHELL#@EXEC_SHELL\$#-- Execute shell command and display output +EXIT#@EXIT\$#-- Quit at once +EXTERN#@EXTERN\$#-- Display using an external browser +EXTERN_LINK#@EXTERN_LINK\$#-- Display target using an external browser +FRAME#@FRAME\$#-- Toggle rendering HTML frames +GOTO#@GOTO\$*#-- Open specified document in a new buffer +GOTO_HOME#@GOTO_HOME\$#-- Return to the homepage (specified HTTP_HOME or WWW_HOME variable) +GOTO_LINE#@GOTO_LINE\$#-- Go to the specified line +GOTO_LINK#@GOTO_LINK\$#-- Follow current hyperlink in a new buffer +GOTO_RELATIVE#@GOTO_RELATIVE\$#-- Go to relative address +HELP#@HELP\$#-- Show help panel +HISTORY#@HISTORY\$#-- Show browsing history +INFO#@INFO\$#-- Display information about the current document +INTERRUPT#@INTERRUPT\$#-- Suspend w3m to background +ISEARCH#@ISEARCH\$#-- Incremental search forward +ISEARCH_BACK#@ISEARCH_BACK\$#-- Incremental search backward +LEFT#@LEFT\$#-- Shift screen one column left +LINE_BEGIN#@LINE_BEGIN\$#-- Go to the beginning of the line +LINE_END#@LINE_END\$#-- Go to the end of the line +LINE_INFO#@LINE_INFO\$#-- Display current position in document +LINK_BEGIN#@LINK_BEGIN\$#-- Move to the first hyperlink +LINK_END#@LINK_END\$#-- Move to the last hyperlink +LINK_MENU#@LINK_MENU\$#-- Pop up link element menu +LIST#@LIST\$*#-- Show all URLs referenced +LIST_MENU#@LIST_MENU\$#-- Pop up menu for hyperlinks to browse to +LOAD#@LOAD\$#-- Open local file in a new buffer +MAIN_MENU#@MAIN_MENU\$#-- Pop up menu +MARK#@MARK\$#-- Set/unset mark +MARK_MID#@MARK_MID\$#-- Turn Message-ID-like strings into hyperlinks +MARK_URL#@MARK_URL\$#-- Turn URL-like strings into hyperlinks +MARK_WORD#@MARK_WORD\$#-- Turn current word into hyperlink +MENU#@MENU\$#-- Pop up menu +MENU_MOUSE#@MENU_MOUSE\$#-- Pop up menu at mouse pointer +MOUSE_TOGGLE#@MOUSE_TOGGLE\$#-- Toggle mouse support +MOVE_DOWN#@MOVE_DOWN\$#-- Cursor down +MOVE_DOWN1#@MOVE_DOWN1\$#-- Cursor down. With edge touched, slide +MOVE_LEFT#@MOVE_LEFT\$#-- Cursor left +MOVE_LEFT1#@MOVE_LEFT1\$#-- Cursor left. With edge touched, slide +MOVE_LIST_MENU#@MOVE_LIST_MENU\$*#-- Pop up menu to navigate between hyperlinks +MOVE_MOUSE#@MOVE_MOUSE\$#-- Move cursor to mouse pointer +MOVE_RIGHT#@MOVE_RIGHT\$#-- Cursor right +MOVE_RIGHT1#@MOVE_RIGHT1\$#-- Cursor right. With edge touched, slide +MOVE_UP#@MOVE_UP\$#-- Cursor up +MOVE_UP1#@MOVE_UP1\$#-- Cursor up. With edge touched, slide +MSGS#@MSGS\$#-- Display error messages +NEW_TAB#@NEW_TAB\$#-- Open a new tab (with current document) +NEXT#@NEXT\$#-- Switch to the next buffer +NEXT_DOWN#@NEXT_DOWN\$#-- Move downward to the next hyperlink +NEXT_HALF_PAGE#@NEXT_HALF_PAGE\$#-- Scroll down half a page +NEXT_LEFT#@NEXT_LEFT\$#-- Move left to the next hyperlink +NEXT_LEFT_UP#@NEXT_LEFT_UP\$#-- Move left or upward to the next hyperlink +NEXT_LINK#@NEXT_LINK\$#-- Move to the next hyperlink +NEXT_MARK#@NEXT_MARK\$#-- Go to the next mark +NEXT_PAGE#@NEXT_PAGE\$#-- Scroll down one page +NEXT_RIGHT#@NEXT_RIGHT\$#-- Move right to the next hyperlink +NEXT_RIGHT_DOWN#@NEXT_RIGHT_DOWN\$#-- Move right or downward to the next hyperlink +NEXT_TAB#@NEXT_TAB\$#-- Switch to the next tab +NEXT_UP#@NEXT_UP\$#-- Move upward to the next hyperlink +NEXT_VISITED#@NEXT_VISITED\$#-- Move to the next visited hyperlink +NEXT_WORD#@NEXT_WORD\$#-- Move to the next word +NOTHING#@NOTHING\$#-- Do nothing +NULL#@NULL\$#-- Do nothing +OPTIONS#@OPTIONS\$#-- Display options setting panel +PEEK#@PEEK\$#-- Show current address +PEEK_IMG#@PEEK_IMG\$#-- Show image address +PEEK_LINK#@PEEK_LINK\$#-- Show target address +PIPE_BUF#@PIPE_BUF\$#-- Pipe current buffer through a shell command and display output +PIPE_SHELL#@PIPE_SHELL\$#-- Execute shell command and display output +PREV#@PREV\$#-- Switch to the previous buffer +PREV_HALF_PAGE#@PREV_HALF_PAGE\$#-- Scroll up half a page +PREV_LINK#@PREV_LINK\$#-- Move to the previous hyperlink +PREV_MARK#@PREV_MARK\$#-- Go to the previous mark +PREV_PAGE#@PREV_PAGE\$#-- Scroll up one page +PREV_TAB#@PREV_TAB\$#-- Switch to the previous tab +PREV_VISITED#@PREV_VISITED\$#-- Move to the previous visited hyperlink +PREV_WORD#@PREV_WORD\$#-- Move to the previous word +PRINT#@PRINT\$#-- Save rendered document +QUIT#@QUIT\$#-- Quit with confirmation request +READ_SHELL#@READ_SHELL\$#-- Execute shell command and display output +REDO#@REDO\$#-- Cancel the last undo +REDRAW#@REDRAW\$#-- Draw the screen anew +REG_MARK#@REG_MARK\$#-- Mark all occurences of a pattern +REINIT#@REINIT\$#-- Reload configuration file +RELOAD#@RELOAD\$#-- Load current document anew +RESHAPE#@RESHAPE\$#-- Re-render document +RIGHT#@RIGHT\$#-- Shift screen one column right +SAVE#@SAVE\$#-- Save document source +SAVE_IMAGE#@SAVE_IMAGE\$#-- Save inline image +SAVE_LINK#@SAVE_LINK\$#-- Save hyperlink target +SAVE_SCREEN#@SAVE_SCREEN\$#-- Save rendered document +SEARCH#@SEARCH\$#-- Search forward +SEARCH_BACK#@SEARCH_BACK\$#-- Search backward +SEARCH_FORE#@SEARCH_FORE\$#-- Search forward +SEARCH_NEXT#@SEARCH_NEXT\$#-- Continue search forward +SEARCH_PREV#@SEARCH_PREV\$#-- Continue search backward +SELECT#@SELECT\$#-- Display buffer-stack panel +SELECT_MENU#@SELECT_MENU\$*#-- Pop up buffer-stack menu +SETENV#@SETENV\$#-- Set environment variable +SET_OPTION#@SET_OPTION\$#-- Set option +SHELL#@SHELL\$#-- Execute shell command and display output +SHIFT_LEFT#@SHIFT_LEFT\$#-- Shift screen left +SHIFT_RIGHT#@SHIFT_RIGHT\$#-- Shift screen right +SOURCE#@SOURCE\$#-- Toggle between HTML shown or processed +STOP_IMAGE#@STOP_IMAGE\$#-- Stop loading and drawing of images +SUBMIT#@SUBMIT\$#-- Submit form +SUSPEND#@SUSPEND\$#-- Suspend w3m to background +TAB_GOTO#@TAB_GOTO\$*#-- Open specified document in a new tab +TAB_GOTO_RELATIVE#@TAB_GOTO_RELATIVE\$#-- Open relative address in a new tab +TAB_LEFT#@TAB_LEFT\$#-- Move left along the tab bar +TAB_LINK#@TAB_LINK\$#-- Follow current hyperlink in a new tab +TAB_MENU#@TAB_MENU\$*#-- Pop up tab selection menu +TAB_MOUSE#@TAB_MOUSE\$#-- Select tab by mouse action +TAB_RIGHT#@TAB_RIGHT\$#-- Move right along the tab bar +UNDO#@UNDO\$#-- Cancel the last cursor movement +UP#@UP\$#-- Scroll the screen up one line +VERSION#@VERSION\$#-- Display the version of w3m +VIEW#@VIEW\$#-- Toggle between HTML shown or processed +VIEW_BOOKMARK#@VIEW_BOOKMARK\$#-- View bookmarks +VIEW_IMAGE#@VIEW_IMAGE\$#-- Display image in viewer +WHEREIS#@WHEREIS\$#-- Search forward +WRAP_TOGGLE#@WRAP_TOGGLE\$#-- Toggle wrapping mode in searches +/usr/share/doc/w3m/README#@README_INTRO&#-- Readme intro page +/usr/share/doc/w3m/README.cookie#@README_COOKIE&#-- Readme cookie page +/usr/share/doc/w3m/README.cygwin#@README_CYGWIN&#-- Readme cygwin page +/usr/share/doc/w3m/README.dict#@README_DICT&#-- Readme dictionary page +/usr/share/doc/w3m/README.func#@README_FUNC&#-- Readme function page +/usr/share/doc/w3m/README.img#@README_IMG&#-- Readme inline image page +/usr/share/doc/w3m/README.m17n#@README_M17N&#-- Readme muntilingualizaion page +/usr/share/doc/w3m/README.mouse#@README_MOUSE&#-- Readme mouse page +/usr/share/doc/w3m/README.passwd#@README_PASSWD&#-- Readme password page +/usr/share/doc/w3m/README.pre_form#@README_PRE_FORM&#-- Readme pre-fill form page +/usr/share/doc/w3m/README.siteconf#@README_SITECONF&#-- Readme siteconf page +/usr/share/doc/w3m/README.sixel#@README_SIXEL&#-- Readme sixel image page +/usr/share/doc/w3m/README.tab#@README_TAB&#-- Readme tab browsing page +/usr/share/doc/w3m/FAQ.html#@README_FAQ&#-- Readme FAQ page +/usr/share/doc/w3m/MANUAL.html#@README_MANUAL&#-- Readme manual page +/usr/share/doc/w3m/STORY.html#@README_STORY&#-- Readme story history of W3M page +fn_click_next.cgi#@CLICK_NEXT&#-- Click next page button 'Next' +fn_click_prev.cgi#@CLICK_PREV&#-- Click previous page button 'Previous' +fn_click_next_arrow.cgi#@CLICK_NEXT_ARROW&#-- Click next page button '>' +fn_click_prev_arrow.cgi#@CLICK_PREV_ARROW&#-- Click previous page button '<' +fn_closetab_stash.cgi#@CLOSE_TAB_STASH&#-- Close tab (Stash URL to ~/.w3m/RestoreTab.txt) +fn_dict_curl.cgi#@DICT_WORD_CURL&#-- Online dictionary for word at cursor +fn_display_borders.cgi#@BORDERS&#-- Toggle table boarders +fn_display_image.cgi#@DISPLAY_IMAGE_TOGGLE&#-- Toggle display image +fn_display_link_number.cgi#@LINK_NUMBER&#-- Toggle link number (hinting mode e.g press 3[ to jump to link 3) +fn_edit_bookmark.cgi#@EDIT_BOOKMARK&#-- Edit bookmark +fn_edit_config.cgi#@EDIT_CONFIG&#-- Edit W3M configuration +fn_edit_keymap.cgi#@EDIT_KEYMAP&#-- Edit W3M keymap +fn_edit_mailcap.cgi#@EDIT_MAILCAP&#-- Edit W3M mailcap +fn_edit_menu.cgi#@EDIT_MENU&#-- Edit W3M context menu +fn_edit_restoretab.cgi#@EDIT_RESTORETAB&#-- Edit W3M restoretab ~/.w3m/RestoreTab.txt +fn_edit_searchengine.cgi#@EDIT_SEARCHENGINES&#-- Edit search engine alias ~/.w3m/cgi-bin/search_engines.cgi +fn_edit_siteconf.cgi#@EDIT_SITECONF&#-- Edit W3M siteconf +fn_edit_surfraw.cgi#@EDIT_SURFRAW&#-- Edit surfraw bookmark ~/.surfraw/bookmark +fn_edit_urimethodmap.cgi#@EDIT_URIMETHODMAP&#-- Edit W3M urimethodmap +fn_engine_duckduckgo.cgi#@ENGE_DDG&*#-- Search the web via duckduckgo +fn_engine_geminispace.cgi#@ENGE_GEMSPC&#-- Search gemini capsules via geminispace +fn_engine_google.cgi#@ENGE_GOOGLE&*#-- Search the web via google +fn_engine_invidious.cgi#@ENGE_INVIDIOUS&#-- Search youtube videos via invidious +fn_engine_1337x.cgi#@ENGE_1337X&*#-- Search 1337x for torrents +fn_engine_piratebay.cgi#@ENGE_TPB&*#-- Search piratebay for torrents +fn_engine_nyaasi.cgi#@ENGE_NYAASI&#-- Search nyaa for anime torrents +fn_engine_xdcceu.cgi#@ENGE_XDCCEU&*#-- Search xdcceu for xdcc (irc dcc files) +fn_engine_veronica2.cgi#@ENGE_V2&#-- Search gopherspace via veronica-2 +fn_engine_wikipedia.cgi#@ENGE_WIKIPEDIA&#-- Search wikipedia for articles +fn_engine_yahoo.cgi#@ENGE_YAHOO&#-- Search the web via yahoo +fn_engine_commandlinefu.cgi#@ENGE_CMDFU&#-- Search for commandline one liners via commandlinefu +fn_goto_tmux_clipboard.cgi#@GOTO_CLIP_TMUX&&#-- Paste URL and go (via tmux clipboard) +fn_goto_w3m_clipboard.cgi#@GOTO_CLIP_W3M&#-- Paste URL and go (via W3M clipboard /tmp/clipbrd.txt) +fn_goto_x11_clipboard.cgi#@GOTO_CLIP_X11&#-- Paste URL and go (via xsel X11 clipboard) +fn_open_link_in_gui_browser.cgi#@GUI_BROWSER_LINK&#-- Open link at cursor in external browser ($BROWSER) +fn_open_page_in_gui_browser.cgi#@GUI_BROWSER_URL&#-- Open page URL in external browser ($BROWSER) +fn_readerview_rdrview.cgi#@RDRVIEW_RDRVIEW&*#-- Reader view using rdrview (c/c++) +fn_readerview_readable.cgi#@RDRVIEW_READABLE&#-- Reader view using readability-cli (nodejs) +fn_readerview_readability.cgi#@RDRVIEW_READABILITY&#-- Reader view using python-readability-lxml (python3) +fn_restore_tab.cgi#@RESTORE_TAB&#-- Restore tab from ~/.w3m/RestoreTab.txt +fn_show_input_line_editing_mode_key_binding.cgi#@LIST_EDIT_MODE_KEY&#-- Show input editing mode key binding +fn_show_user_defined_key_binding.cgi#@LIST_DEFINED_KEY&*#-- Show user custom key binding +fn_toggle_color.cgi#@COLOR&#-- Toggle color +fn_toggle_line_number.cgi#@LINE_NUMBER&*#-- Toggle line number +fn_treat_url_like_strings.cgi#@TREAT_URL&*#-- Toggle plain text to clickable link +fn_user_agent_clear.cgi#@USER_AGENT_CLEAR&#-- Clear user agent string +fn_user_agent_set.cgi#@USER_AGENT_SET&#-- Set user agent string +fn_yank_current_link.cgi#@YANK_LINK&*#-- Copy link at cursor to clipboard +fn_yank_page_url.cgi#@YANK_URL&*#-- Copy page URL to clipboard +fn_save_session.cgi#@SAVE_SESSION&*#-- Save session and ask to quit (run 'w3mlastsession' command to restore) +fn_tts_espeak_page.cgi#@TTS_ESPEAK_PAGE&*#-- Espeak-ng text to speech whole page (Press Ctrl+C to continue browsing) +fn_tts_espeak_word.cgi#@TTS_ESPEAK_WORD&#-- Espeak-ng text to speech single word +fn_tts_festival_page.cgi#@TTS_FESTIVAL_PAGE&#-- Festival text to speech whole page (Press Ctrl+C to continue browsing) +fn_tts_festival_word.cgi#@TTS_FESTIVAL_WORD&#-- Festival text to speech single word +fn_tts_svoxpico_page.cgi#@TTS_SVOXPICO_PAGE&#-- SVOX Pico text to speech whole page (Press Ctrl+C to continue browsing) +fn_tts_svoxpico_word.cgi#@TTS_SVOXPICO_WORD&#-- SVOX Pico text to speech single word +fn_tts_kill.cgi#@TTS_KILL&*#-- Killall text to speech playback in progress +fn_diana_add.cgi#@DIANA_ADD&*#-- Add to aria2 daemon for downloading +fn_diana_addpaused.cgi#@DIANA_ADDPAUSED&*#-- Add to aria2 daemon for downloading (paused state) +fn_aria2p.cgi#@TUI_ARIA2P&#-- Aria2p TUI aria2 daemon download manager (python3) +fn_aria2t.cgi#@TUI_ARIA2T&#-- Aria2t TUI aria2 daemon download manager (c/c++) +http://wttr.in#@WWW_WTTR&#-- Check weather forecast +https://text.npr.org#@WWW_NPR&#-- NPR latest news +http://lite.cnn.io/en#@WWW_CNN&#-- Breaking news +http://68k.news/#@WWW_68k&#-- Headlines from the future +https://news.ycombinator.com#@WWW_HN&#-- Hacker news +https://thepiratebay10.org/top/all#@WWW_TPB&#-- Piratebay top 100 torrents +https://1337x.to/top-100#@WWW_1337X&#-- 1337x top 100 torrents +https://raw.githubusercontent.com/tats/w3m/master/ChangeLog#@WWW_W3MCLOG&#-- W3M updated changelog +https://github.com/tats/w3m/issues#@WWW_W3MISSUE&#-- W3M open issue +https://www.reddit.com/r/w3m/.mobile#@WWW_W3M&#-- W3M subreddit +https://www.reddit.com/r/commandline/.mobile#@WWW_CLI&#-- Commandline subreddit +https://www.reddit.com/r/linux/.mobile#@WWW_GNU&#-- GNU/Linux subreddit +gopher://bitreich.org/1/lawn#@WWW_LAWN&#-- Gopher list of popular gopherhole +~/Downloads#@DIR_DL&#-- Open ~/Downloads directory +/media#@DIR_MEDIA&#-- Open /media directory +EOF +} + +# clear screen +printf "\033c" + +w3m_fnx_clipboard=/tmp/w3m_fnx_clipboard.txt + +# not running tmux +if [ "$TMUX_PANE" = "%0" ] || [ -z "$TMUX" ] || [ -z "$TERM_PROGRAM" ] ; then + selection="$( fnx_database | sort -t '@' -k2 | column -t -s '#' | \ + fzf -i -e --delimiter '@' --with-nth 2.. --prompt='fzf-miru [$func|&custom|*fav] (run a W3M command): ' \ + --info=default --layout=reverse --tiebreak=index | \ + awk '{print $1}' )" + [ -z "$selection" ] && echo "" > "$w3m_fnx_clipboard" && exit +# tmux -ge 3.2 popup +elif [ "$TERM_PROGRAM" = tmux ] ; then + selection="$( fnx_database | sort -t '@' -k2 | column -t -s '#' | \ + fzf-tmux -p -w 80% -h 70% -i -e --delimiter '@' --with-nth 2.. --prompt='fzf-miru [$func|&custom|*fav] (run a W3M command): ' \ + --info=default --layout=reverse --tiebreak=index | \ + awk '{print $1}' )" + [ -z "$selection" ] && echo "" > "$w3m_fnx_clipboard" && exit +# tmux -lt 3.2 regular split +elif [ -n "$TMUX" ] ; then + selection="$( fnx_database | sort -t '@' -k2 | column -t -s '#' | \ + fzf-tmux -i -e --delimiter '@' --with-nth 2.. --prompt='fzf-miru [$func|&custom|*fav] (run a W3M command): ' \ + --info=default --layout=reverse --tiebreak=index | + awk '{print $1}' )" + [ -z "$selection" ] && echo "" > "$w3m_fnx_clipboard" && exit +fi +echo "$selection" > "$w3m_fnx_clipboard" diff --git a/.w3m/cgi-bin/fnx_generate.cgi b/.w3m/cgi-bin/fnx_generate.cgi new file mode 100755 index 0000000..2ed53df --- /dev/null +++ b/.w3m/cgi-bin/fnx_generate.cgi @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# generate w3m functions to proper formatting for fzf menu +cat /usr/share/doc/w3m/README.func | while read -r line; do + func_name="$(echo "$line" | awk '{print $1;}')" + description="$(echo "$line" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')" + echo "${func_name}#@${func_name}\\\$#-- ${description}" +done diff --git a/.w3m/cgi-bin/fzf_surfraw.cgi b/.w3m/cgi-bin/fzf_surfraw.cgi new file mode 100755 index 0000000..dec13de --- /dev/null +++ b/.w3m/cgi-bin/fzf_surfraw.cgi @@ -0,0 +1,42 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: interactive surfraw smart prefix search engine +# DEMO: https://youtu.be/p5NZb8f8AHA | updated https://youtu.be/0j3pUfZjCeQ +# DEPEND: surfraw fzf gawk coreutils grep +# REQD: 1. chmod +x ~/.w3m/cgi-bin/fzf_surfraw.cgi +# 2. chmod +x ~/.w3m/cgi-bin/goto_w3m_clipboard.cgi +# 3. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 4. sed -i 's@default_url.*@default_url 1@g' ~/.w3m/config +# 5. $EDITOR ~/.w3m/keymap +# # search with surfraw (no clipboard required) +# keymap xs COMMAND "READ_SHELL ~/.w3m/cgi-bin/fzf_surfraw.cgi ; BACK ; GOTO file:/cgi-bin/goto_w3m_clipboard.cgi" +# keymap XS COMMAND "READ_SHELL ~/.w3m/cgi-bin/fzf_surfraw.cgi ; BACK ; TAB_GOTO file:/cgi-bin/goto_w3m_clipboard.cgi" + +# CLOG: 2021-05-23 detect if tmux is running then use fzf-tmux split pane +# 2021-05-22 fzf --tiebreak to sort, no longer require any clipboard use tmpfile instead +# 2021-04-11 remove read command for posix compatible (good idea by https://github.com/NapoleonWils0n) +# new keymap use READ_SHELL and tmux load-buffer to avoid unnecessary prompt +# 2021-02-05 copy to all 3 clipboard at once; xsel primary/system clipboard, tmux clipboard +# 2020-05-08 surfraw -p instead of echo +# 2020-04-27 starting point + +# clear screen +printf "\033c" + +# check if tmux is running on current window +if [ "$TERM_PROGRAM" = tmux ]; then + PREFIX=$(surfraw -elvi | grep -v 'LOCAL\|GLOBAL' | fzf-tmux -d 30% -e --prompt='Pick search engine: ' --info=inline --layout=reverse --tiebreak=index | awk '{print $1}') + [ -z "$PREFIX" ] && exit + INPUT=$(printf "\n" | fzf-tmux -d 30% --print-query --prompt="Enter keyword(s) to search ${PREFIX}: " --info=inline --layout=reverse) +else + PREFIX=$(surfraw -elvi | grep -v 'LOCAL\|GLOBAL' | fzf -e --prompt='Pick search engine: ' --info=inline --layout=reverse --tiebreak=index | awk '{print $1}') + [ -z "$PREFIX" ] && exit + INPUT=$(printf "\n" | fzf --print-query --prompt="Enter keyword(s) to search ${PREFIX}: " --info=inline --layout=reverse) +fi + +# NOTE: dont quote $INPUT it will mess up results +# surfraw -p "$PREFIX" $INPUT | xsel -p # xsel primary (aka shift-insert or middle click to paste) +# surfraw -p "$PREFIX" $INPUT | xsel -b # xsel system (aka ctrl-v to paste) +# surfraw -p "$PREFIX" $INPUT | tmux load-buffer - +surfraw -p "$PREFIX" $INPUT > /tmp/clipbrd.txt # clipboard using tmpfile diff --git a/.w3m/cgi-bin/gemini.cgi b/.w3m/cgi-bin/gemini.cgi new file mode 100755 index 0000000..30d0a01 --- /dev/null +++ b/.w3m/cgi-bin/gemini.cgi @@ -0,0 +1,28 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: gemini proxy to connect over http with w3m web browser +# DEMO: https://youtu.be/mfnCqn4qhL0 +# DEPEND: coreutils curl grep +# REQD: 1. touch ~/.w3m/urimethodmap +# 2. echo "gemini: file:/cgi-bin/gemini.cgi?%s" >> ~/.w3m/urimethodmap +# 3. chmod +x ~/.w3m/cgi-bin/gemini.cgi +# 4. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 5. sed -i 's@urimethodmap.*@urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap@g' ~/.w3m/config +# CLOG: +# 2021-07-30 use curl instead of ping + +# gemini://gempaper.strangled.net/mirrorlist/ +# gemini://simplynews.metalune.xyz +# gemini://geminispace.info/search?tmux + +# remove gemini:// header +QUERY_STRING=$(echo "$QUERY_STRING" | cut -d '/' -f3-) + +if [ "$(curl --connect-timeout 1 -s -I "https://portal.mozz.us/about" | head -n1 | grep 200 > /dev/null && echo $? )" = 0 ]; then + echo "W3m-control: GOTO https://portal.mozz.us/gemini/$QUERY_STRING" +elif [ "$(curl --connect-timeout 1 -s -I "https://proxy.vulpes.one" | head -n1 | grep 200 > /dev/null && echo $? )" = 0 ]; then + echo "W3m-control: GOTO https://proxy.vulpes.one/gemini/$QUERY_STRING" +else + echo "W3m-control: GOTO https://gemproxy.koyu.space/$QUERY_STRING" +fi diff --git a/.w3m/cgi-bin/gopher.cgi b/.w3m/cgi-bin/gopher.cgi new file mode 100755 index 0000000..6309f27 --- /dev/null +++ b/.w3m/cgi-bin/gopher.cgi @@ -0,0 +1,25 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# DESC: gopher web proxy to connect over http +# DEMO: https://youtu.be/5zDZm6hvbQ8 +# REQD: 1. touch ~/.w3m/urimethodmap +# 2. echo "gopher: file:/cgi-bin/gopher.cgi?%s" >> ~/.w3m/urimethodmap +# 3. chmod +x ~/.w3m/cgi-bin/gopher.cgi +# 4. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 5. sed -i 's@urimethodmap.*@urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap@g' ~/.w3m/config +# 6. touch ~/.w3m/siteconf +# 7. echo 'url m!^gopher?://!' >> ~/.w3m/siteconf +# 8. echo 'substitute_url "file:/cgi-bin/gopher.cgi?"' >> ~/.w3m/siteconf + +# gopher://bitreich.org/1/lawn +# gopher://hngopher.com/ +# gopher://bay.parazy.de:666 + +proxycheck() { curl --connect-timeout 1 -s -I "$1" | head -n1 | grep 200 > /dev/null && echo $? ;} + +if [ "$(proxycheck "https://gopher.floodgap.com/gopher/")" = 0 ]; then + echo "W3m-control: GOTO https://gopher.floodgap.com/gopher/gw?$QUERY_STRING" +else + echo "W3m-control: GOTO https://gopherproxy.meulie.net/$QUERY_STRING" +fi diff --git a/.w3m/cgi-bin/goto_clipboard.cgi b/.w3m/cgi-bin/goto_clipboard.cgi new file mode 100755 index 0000000..2459d02 --- /dev/null +++ b/.w3m/cgi-bin/goto_clipboard.cgi @@ -0,0 +1,30 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: paste and go feature for w3m web browser using system clipboard (aka ctrl+v) +# DEMO: https://youtu.be/p5NZb8f8AHA | updated https://youtu.be/0j3pUfZjCeQ +# REQD: 1. chmod +x ~/.w3m/cgi-bin/goto_clipboard.cgi +# 2. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@default_url.*@default_url 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# keymap pp GOTO file:/cgi-bin/goto_clipboard.cgi +# keymap PP TAB_GOTO file:/cgi-bin/goto_clipboard.cgi + +# REFF: https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m +# CLOG: 2021-05-22 version 0.3 new instructions, no longer required root path for cgi scripts +# 2021-02-05 version 0.2 reset url back to 1 (aka edit current url) +# 2020-04-26 version 0.1 + +# set open-url value to zero (aka empty url line) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=0" + +#GOTO url in clipboard in current page. If the clipboard has a +#"non url string/nothing" an blank page is shown. +printf "%s\r\n" "W3m-control: GOTO $(xsel -ob)" + +#delete the buffer (element in history) created between the current page and +#the searched page by calling this script. +printf "%s\r\n" "W3m-control: DELETE_PREVBUF" + +# set default open-url value to one (aka current url) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=1" diff --git a/.w3m/cgi-bin/goto_clipboard_primary.cgi b/.w3m/cgi-bin/goto_clipboard_primary.cgi new file mode 100755 index 0000000..873b94e --- /dev/null +++ b/.w3m/cgi-bin/goto_clipboard_primary.cgi @@ -0,0 +1,29 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: paste and go feature for w3m web browser using primary clipboard (aka shift+insert) +# DEMO: https://youtu.be/p5NZb8f8AHA | updated https://youtu.be/0j3pUfZjCeQ +# REQD: 1. chmod +x ~/.w3m/cgi-bin/goto_clipboard_primary.cgi +# 2. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@default_url.*@default_url 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# keymap pp GOTO file:/cgi-bin/goto_clipboard_primary.cgi +# keymap PP TAB_GOTO file:/cgi-bin/goto_clipboard_primary.cgi + +# CLOG: 2021-05-22 version 0.3 new instructions, no longer required root path for cgi scripts +# 2021-02-05 version 0.2 reset url back to 1 (aka edit current url) +# 2020-04-26 version 0.1 + +# set open-url value to zero (aka empty url line) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=0" + +#GOTO url in clipboard in current page. If the clipboard has a +#"non url string/nothing" an blank page is shown. +printf "%s\r\n" "W3m-control: GOTO $(xsel -op)" + +#delete the buffer (element in history) created between the current page and +#the searched page by calling this script. +printf "%s\r\n" "W3m-control: DELETE_PREVBUF" + +# set default open-url value to one (aka current url) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=1" diff --git a/.w3m/cgi-bin/goto_tmux_clipboard.cgi b/.w3m/cgi-bin/goto_tmux_clipboard.cgi new file mode 100755 index 0000000..85db2cb --- /dev/null +++ b/.w3m/cgi-bin/goto_tmux_clipboard.cgi @@ -0,0 +1,29 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: paste and go feature for w3m web browser using tmux clipboard +# DEMO: https://youtu.be/p5NZb8f8AHA | updated https://youtu.be/0j3pUfZjCeQ +# REQD: 1. chmod +x ~/.w3m/cgi-bin/goto_tmux_clipboard.cgi +# 2. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@default_url.*@default_url 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# keymap pt GOTO file:/cgi-bin/goto_tmux_clipboard.cgi +# keymap PT TAB_GOTO file:/cgi-bin/goto_tmux_clipboard.cgi +# +# CLOG: 2021-05-22 version 0.3 new instructions, no longer required root path for cgi scripts +# 2021-02-05 version 0.2 reset url back to 1 (aka edit current url) +# 2020-04-26 version 0.1 + +# set open-url value to zero (aka empty url line) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=0" + +#GOTO url in clipboard in current page. If the clipboard has a +#"non url string/nothing" an blank page is shown. +printf "%s\r\n" "W3m-control: GOTO $(tmux paste-buffer)" + +#delete the buffer (element in history) created between the current page and +#the searched page by calling this script. +printf "%s\r\n" "W3m-control: DELETE_PREVBUF" + +# set default open-url value to one (aka current url) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=1" diff --git a/.w3m/cgi-bin/goto_w3m_clipboard.cgi b/.w3m/cgi-bin/goto_w3m_clipboard.cgi new file mode 100755 index 0000000..47027a8 --- /dev/null +++ b/.w3m/cgi-bin/goto_w3m_clipboard.cgi @@ -0,0 +1,27 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: paste and go feature for w3m web browser +# DEMO: https://youtu.be/p5NZb8f8AHA | updated https://youtu.be/0j3pUfZjCeQ +# REQD: 1. chmod +x ~/.w3m/cgi-bin/goto_w3m_clipboard.cgi +# 2. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@default_url.*@default_url 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# keymap pw GOTO file:/cgi-bin/goto_w3m_clipboard.cgi +# keymap PW TAB_GOTO file:/cgi-bin/goto_w3m_clipboard.cgi +# +# CLOG: 2021-05-22 0.1 + +# set open-url value to zero (aka empty url line) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=0" + +#GOTO url in clipboard in current page. If the clipboard has a +#"non url string/nothing" an blank page is shown. +printf "%s\r\n" "W3m-control: GOTO $(cat /tmp/clipbrd.txt)" + +#delete the buffer (element in history) created between the current page and +#the searched page by calling this script. +printf "%s\r\n" "W3m-control: DELETE_PREVBUF" + +# set default open-url value to one (aka current url) +printf "%s\r\n" "W3m-control: SET_OPTION default_url=1" diff --git a/.w3m/cgi-bin/magnet.cgi b/.w3m/cgi-bin/magnet.cgi new file mode 100755 index 0000000..7bff061 --- /dev/null +++ b/.w3m/cgi-bin/magnet.cgi @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: send magnet links to your torrent client (for W3M Web Browser) +# DEMO: https://youtu.be/T74FqHMHjN0 +# REFF: decodingurl https://sodocumentation.net/bash/topic/10895/decoding-url +# REQD: 1. touch ~/.w3m/urimethodmap +# 2. echo "magnet: file:/cgi-bin/magnet.cgi?%s" >> ~/.w3m/urimethodmap +# 3. chmod +x ~/.w3m/cgi-bin/magnet.cgi +# 4. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 5. sed -i 's@urimethodmap.*@urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap@g' ~/.w3m/config + +# CLOG: 2021-05-22 0.2 decode any encoded url (e.g gopherbay on floodgap web proxy) +# 2021-05-15 0.1 all w3m-control + +QUERY_STRING="$(printf "%s" "$QUERY_STRING" | sed -e "s/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g" | xargs -0 echo -e)" +transmission-remote --add "$QUERY_STRING" +printf "%s\r\n" "W3m-control: BACK" diff --git a/.w3m/cgi-bin/magnet.py b/.w3m/cgi-bin/magnet.py new file mode 100755 index 0000000..16f53ab --- /dev/null +++ b/.w3m/cgi-bin/magnet.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python2 +# Author: Alexandre Boeglin +# Info: send magnet links to your torrent client +# Source: http://boeglin.org/blog/index.php?entry=Handling-magnet-URIs-with-w3m + +########## SETUP ########################## +# 1. touch ~/.w3m/urimethodmap +# 2. echo "magnet: file:/cgi-bin/magnet.py?%s" >> ~/.w3m/urimethodmap +# 3. chmod +x ~/.w3m/cgi-bin/magnet.py +# 4. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 5. sed -i 's@urimethodmap.*@urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap@g' ~/.w3m/config +# 6. edit below ==> cmd_list = ("transmission-remote", "-a", uri) +########################################### + +# coding=utf-8 +import sys +import os +import subprocess + +uri = os.environ.get('QUERY_STRING') +referer = os.environ.get('HTTP_REFERER') + +if not uri: + print + print "Error: No URI" + sys.exit() + +cmd_list = ("transmission-remote", "-a", uri) + +subprocess.call(cmd_list) + +if referer: + print "HTTP/1.1 303 See Other" + print "Location: %s" % referer + diff --git a/.w3m/cgi-bin/omnibar_1337x.cgi b/.w3m/cgi-bin/omnibar_1337x.cgi new file mode 100755 index 0000000..44f746e --- /dev/null +++ b/.w3m/cgi-bin/omnibar_1337x.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://1337x.to/search/$QUERY_STRING/1/" +echo "w3m-control: NEXT_PAGE" diff --git a/.w3m/cgi-bin/omnibar_aspell.cgi b/.w3m/cgi-bin/omnibar_aspell.cgi new file mode 100755 index 0000000..dde6cc1 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_aspell.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO http://suggest.aspell.net/index.php/advance?word=$QUERY_STRING&spelling=american&dict=normal&sugmode=slow" diff --git a/.w3m/cgi-bin/omnibar_bing.cgi b/.w3m/cgi-bin/omnibar_bing.cgi new file mode 100755 index 0000000..d7dc46a --- /dev/null +++ b/.w3m/cgi-bin/omnibar_bing.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://www.bing.com/search?q=$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_brave.cgi b/.w3m/cgi-bin/omnibar_brave.cgi new file mode 100755 index 0000000..a38398b --- /dev/null +++ b/.w3m/cgi-bin/omnibar_brave.cgi @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# DESC: use the address bar to do search engine searches +# DEMO: https://youtu.be/77qhjaoj_2k +# REQD: 1. chmod +x ~/.w3m/cgi-bin/omnibar_google.cgi +# 2. sed -i 's@^cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@^use_dictcommand.*@use_dictcommand 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# ############################ Execute omnibar command (DICT_WORD) +# keymap sg COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_google.cgi ; DICT_WORD" +# ############################ Execute omnibar command for word at cursor (DICT_WORD_AT) +# keymap sG COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_google.cgi ; DICT_WORD_AT" + +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://search.brave.com/search?q=$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_duckduckgo.cgi b/.w3m/cgi-bin/omnibar_duckduckgo.cgi new file mode 100755 index 0000000..0f886a0 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_duckduckgo.cgi @@ -0,0 +1,17 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# DESC: use the address bar to do search engine searches +# DEMO: https://youtu.be/77qhjaoj_2k +# REQD: 1. chmod +x ~/.w3m/cgi-bin/omnibar_duckduckgo.cgi +# 2. sed -i 's@^cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@^use_dictcommand.*@use_dictcommand 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# ############################ Execute omnibar command (DICT_WORD) +# keymap sd COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_duckduckgo.cgi ; DICT_WORD" +# ############################ Execute omnibar command for word at cursor (DICT_WORD_AT) +# keymap sD COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_duckduckgo.cgi ; DICT_WORD_AT" + +# ddg flags https://duckduckgo.com/params +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://lite.duckduckgo.com/lite/?q=$QUERY_STRING&kf=-1&kz=-1&kq=-1&kv=-1&k1=-1&kp=-2&kaf=1&kd=-1&kf=-1&kz=-1&kq=-1&kv=-1" diff --git a/.w3m/cgi-bin/omnibar_geminispace.cgi b/.w3m/cgi-bin/omnibar_geminispace.cgi new file mode 100755 index 0000000..954491c --- /dev/null +++ b/.w3m/cgi-bin/omnibar_geminispace.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://portal.mozz.us/gemini/geminispace.info/search%3F$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_google.cgi b/.w3m/cgi-bin/omnibar_google.cgi new file mode 100755 index 0000000..6cbf590 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_google.cgi @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# DESC: use the address bar to do search engine searches +# DEMO: https://youtu.be/77qhjaoj_2k +# REQD: 1. chmod +x ~/.w3m/cgi-bin/omnibar_google.cgi +# 2. sed -i 's@^cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. sed -i 's@^use_dictcommand.*@use_dictcommand 1@g' ~/.w3m/config +# 4. $EDITOR ~/.w3m/keymap +# ############################ Execute omnibar command (DICT_WORD) +# keymap sg COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_google.cgi ; DICT_WORD" +# ############################ Execute omnibar command for word at cursor (DICT_WORD_AT) +# keymap sG COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_google.cgi ; DICT_WORD_AT" + +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://www.google.com/search?q=$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_nyaasi.cgi b/.w3m/cgi-bin/omnibar_nyaasi.cgi new file mode 100755 index 0000000..f8abfc4 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_nyaasi.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://nyaa.si/?f=2&c=0_0&q=$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_piratebay.cgi b/.w3m/cgi-bin/omnibar_piratebay.cgi new file mode 100755 index 0000000..b2c36e0 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_piratebay.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +QUERY_STRING="${QUERY_STRING//+/%20}" +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://thepiratebay10.org/search/$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_subreddit.cgi b/.w3m/cgi-bin/omnibar_subreddit.cgi new file mode 100755 index 0000000..657d7f5 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_subreddit.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://www.reddit.com/r/$QUERY_STRING/.mobile" diff --git a/.w3m/cgi-bin/omnibar_twitch.cgi b/.w3m/cgi-bin/omnibar_twitch.cgi new file mode 100755 index 0000000..9ee5038 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_twitch.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +QUERY_STRING="${QUERY_STRING//+/%20}" +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://m.twitch.tv/directory/game/$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_veronica2.cgi b/.w3m/cgi-bin/omnibar_veronica2.cgi new file mode 100755 index 0000000..5e450bd --- /dev/null +++ b/.w3m/cgi-bin/omnibar_veronica2.cgi @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +GOPHER_PROTOCOL_ENABLE=$(w3m -version | grep -c "gopher") +echo "w3m-control: BACK" +if [ "$GOPHER_PROTOCOL_ENABLE" = 0 ] ; then + echo "w3m-control: TAB_GOTO https://gopher.floodgap.com/gopher/gw?ss=gopher%3A%2F%2Fgopher.floodgap.com%2F7%2Fv2%2Fvs&sq=$QUERY_STRING" +else + echo "w3m-control: TAB_GOTO gopher://gopher.floodgap.com/7/v2/vs?$QUERY_STRING" +fi diff --git a/.w3m/cgi-bin/omnibar_wikipedia.cgi b/.w3m/cgi-bin/omnibar_wikipedia.cgi new file mode 100755 index 0000000..0855369 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_wikipedia.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://en.wikipedia.org/w/index.php?search=$QUERY_STRING&title=Special%3ASearch&profile=default&fulltext=1&ns0=1" diff --git a/.w3m/cgi-bin/omnibar_xdcceu.cgi b/.w3m/cgi-bin/omnibar_xdcceu.cgi new file mode 100755 index 0000000..b876015 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_xdcceu.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://www.xdcc.eu/search.php?searchkey=$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_yahoo.cgi b/.w3m/cgi-bin/omnibar_yahoo.cgi new file mode 100755 index 0000000..70831c5 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_yahoo.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://search.yahoo.com/search?p=$QUERY_STRING" diff --git a/.w3m/cgi-bin/omnibar_yewtube.cgi b/.w3m/cgi-bin/omnibar_yewtube.cgi new file mode 100755 index 0000000..5893f21 --- /dev/null +++ b/.w3m/cgi-bin/omnibar_yewtube.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +echo "w3m-control: BACK" +echo "w3m-control: TAB_GOTO https://yewtu.be/search?q=$QUERY_STRING" +echo "w3m-control: NEXT_PAGE" diff --git a/.w3m/cgi-bin/redirect_duckduckgo.cgi b/.w3m/cgi-bin/redirect_duckduckgo.cgi new file mode 100755 index 0000000..c21741a --- /dev/null +++ b/.w3m/cgi-bin/redirect_duckduckgo.cgi @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: remove all duckduckgo redirect links +# DEMO: https://youtu.be/rM5vBRfwwzc +# REFF: grep string between two words https://stackoverflow.com/a/13245961 +# REQD: 1. $EDITOR ~/.w3m/siteconf +# url m@^https?://duckduckgo.com/l/\?uddg@ +# substitute_url "file:///cgi-bin/redirect_duckduckgo.cgi?" +# 2. chmod +x ~/.w3m/cgi-bin/redirect_duckduckgo.cgi +# 3. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config + +W3M_CURRENT_LINK="$(printf "%s" "$W3M_CURRENT_LINK" | grep -oP '(?<=duckduckgo.com\/l\/\?uddg=).*(?=&)' | sed -e "s/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g" | xargs -0 echo -e)" +printf "%s\r\n" "W3m-control: GOTO $W3M_CURRENT_LINK" +printf "%s\r\n" "W3m-control: DELETE_PREVBUF" + diff --git a/.w3m/cgi-bin/redirect_google.cgi b/.w3m/cgi-bin/redirect_google.cgi new file mode 100755 index 0000000..0dfe470 --- /dev/null +++ b/.w3m/cgi-bin/redirect_google.cgi @@ -0,0 +1,15 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: remove all google redirect links +# DEMO: https://youtu.be/rM5vBRfwwzc +# REQD: 1. $EDITOR ~/.w3m/siteconf +# url m@^https?://(.*\.)google.com/url@ +# substitute_url "file:///cgi-bin/redirect_google.cgi?" +# 2. chmod +x ~/.w3m/cgi-bin/redirect_google.cgi +# 3. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config + +W3M_CURRENT_LINK="$(printf "%s" "$W3M_CURRENT_LINK" | grep -oP '(?<=google.com\/url\?q=)[^&]*(?=&)' | sed -e "s/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g" | xargs -0 echo -e)" +printf "%s\r\n" "W3m-control: GOTO $W3M_CURRENT_LINK" +printf "%s\r\n" "W3m-control: DELETE_PREVBUF" + diff --git a/.w3m/cgi-bin/redirect_gopher.cgi b/.w3m/cgi-bin/redirect_gopher.cgi new file mode 100755 index 0000000..1bfc1f0 --- /dev/null +++ b/.w3m/cgi-bin/redirect_gopher.cgi @@ -0,0 +1,20 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: remove all hURL gopher header links (for W3M Web Browser with native gopher support) +# DEMO: https://youtu.be/rM5vBRfwwzc +# REQD: 1. $EDITOR ~/.w3m/siteconf +# url m@^gopher?://(.*)hURL:@ +# substitute_url "file:///cgi-bin/redirect_gopher.cgi?" +# 2. chmod +x ~/.w3m/cgi-bin/redirect_gopher.cgi +# 3. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config + +# Note: check if you have native gopher protocol support +# $ w3m -version +# $ w3m gopher://bitreich.org/1/lawn + +# remove gopher hURL header link +# e.g gopher://gopher.floodgap.com/hURL:http://www.floodgap.com/ --> http://www.floodgap.com/ +QUERY_STRING=$(printf "%s" "$QUERY_STRING" | sed 's@^gopher.*hURL:@@') +printf "%s\r\n" "W3m-control: GOTO $QUERY_STRING" +printf "%s\r\n" "W3m-control: DELETE_PREVBUF" diff --git a/.w3m/cgi-bin/restore_session.cgi b/.w3m/cgi-bin/restore_session.cgi new file mode 100755 index 0000000..8b840fb --- /dev/null +++ b/.w3m/cgi-bin/restore_session.cgi @@ -0,0 +1,51 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: generate a script for your last w3m session then you can run script to restore all urls in new tabs +# DEMO: https://youtu.be/qYhNJ3itqWw +# DEPEND: coreutils gawk sed +# REQD: 1. chmod +x ~/.w3m/cgi-bin/restore_session.cgi +# 2. $EDITOR ~/.bashrc +# [ -d "$HOME/.w3m/bin" ] && PATH="$HOME/.w3m/bin:$PATH" +# 3. $EDITOR ~/.w3m/keymap +# ############################ Quit with confirmation request (QUIT) +# keymap :q QUIT +# keymap ZZ QUIT +# ############################ Quit at once (EXIT) +# keymap ZQ EXIT +# ############################ Quit at once and save session +# keymap Q COMMAND "EXTERN 'echo %s > ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; READ_SHELL ~/.w3m/cgi-bin/restore_session.cgi ; EXIT" +# 4. To load w3m with the last session +# $ w3mlastsession + +# CLOG: 2021-05-15 remove multiple -N flag +# 2021-04-17 first draft, no option to jump to tab 1 at the moment + +## --------------------------------------------- +# location of generated script of last session +mkdir -p "$HOME/.w3m/bin" +RESTORE_SESSSION="$HOME/.w3m/bin/w3mlastsession" + +# add shell header +echo "#!/usr/bin/env sh" > "$RESTORE_SESSSION" +echo "w3m -N \\" >> "$RESTORE_SESSSION" + +# remove dupes without sorting and append trailing slash to each url +awk '!x[$0]++' "$HOME/.w3m/RestoreSession.txt" | while read -r line ; do echo "'$line' \\" >> "$RESTORE_SESSSION" ; done + +# remove last trailing slash of the last line +sed -i '$ s-.$--' "$RESTORE_SESSSION" + +chmod +x "$RESTORE_SESSSION" + +## OUTPUT SCRIPT FILE EXAMPLE ~/.w3m/bin/w3mlastsession +## -------------------------------------------------- +## #!/usr/bin/env sh +## w3m -N \ +## 'https://www.reddit.com/r/w3m/.mobile' \ +## 'https://www.reddit.com/r/commandline/.mobile' \ +## 'https://www.reddit.com/r/linux/.mobile' \ +## 'http://lite.cnn.com/en' \ +## 'https://raw.githubusercontent.com/tats/w3m/master/ChangeLog' \ +## 'https://github.com/gotbletu/shownotes' +## -------------------------------------------------- diff --git a/.w3m/cgi-bin/restore_tab.cgi b/.w3m/cgi-bin/restore_tab.cgi new file mode 100755 index 0000000..9fa23de --- /dev/null +++ b/.w3m/cgi-bin/restore_tab.cgi @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +# AUTHOR: felipesaa (https://github.com/felipesaa) +# DESC: restore a closed tab in w3m +# DEMO: https://youtu.be/e5_q3-r6PAU +# RQMTS: 1. chmod +x ~/.w3m/cgi-bin/restore_tab.cgi +# 2. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 3. $EDITOR ~/.w3m/keymap +# keymap d COMMAND "EXTERN 'echo %s >> ~/.w3m/RestoreTab.txt' ; CLOSE_TAB" +# keymap u TAB_GOTO file:/cgi-bin/restore_tab.cgi + +#Open the last closed tab +last_tab=$(tail -n 1 ~/.w3m/RestoreTab.txt); +#limit of tabs stored +limit=$(tail -n 20 ~/.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" diff --git a/.w3m/cgi-bin/search_engines.cgi b/.w3m/cgi-bin/search_engines.cgi new file mode 100755 index 0000000..9688a3f --- /dev/null +++ b/.w3m/cgi-bin/search_engines.cgi @@ -0,0 +1,92 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# DESC: w3m search engine alias (aka omnibar smart keywords search) +# DEMO: https://youtu.be/bWlPpacFPlI +# W3M Playlist https://www.youtube.com/playlist?list=PLqv94xWU9zZ35Yv0s6zMID5JoS8qu19Kh +# REFF: https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m/blob/master/cgi-bin/search_engines.cgi +# https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m/blob/master/documentation/search_engines.txt +# https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m/blob/master/urimethodmap +# frakswe search surfraw urimethodmap https://pastebin.com/raw/TUcRgu9y +# https://rubikitch.hatenadiary.org/entry/20070830/searchengine +# REQD: 1. touch ~/.w3m/urimethodmap +# 2. $EDITOR ~/.w3m/urimethodmap +# # search engine alias +# # note: no trailing space after %s +# 1x: file:/cgi-bin/search_engines.cgi?%s +# dd: file:/cgi-bin/search_engines.cgi?%s +# gg: file:/cgi-bin/search_engines.cgi?%s +# gs: file:/cgi-bin/search_engines.cgi?%s +# pb: file:/cgi-bin/search_engines.cgi?%s +# rd: file:/cgi-bin/search_engines.cgi?%s +# wi: file:/cgi-bin/search_engines.cgi?%s +# v2: file:/cgi-bin/search_engines.cgi?%s +# ya: file:/cgi-bin/search_engines.cgi?%s +# yt: file:/cgi-bin/search_engines.cgi?%s +# 3. chmod +x ~/.w3m/cgi-bin/search_engines.cgi +# 4. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config +# 5. sed -i 's@urimethodmap.*@urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap@g' ~/.w3m/config +# 6. sed -i 's@space_autocomplete.*@space_autocomplete 0@g' ~/.w3m/config +# USAGE: <SearchEngine>:<Keywords> +# 1. $ w3m -v +# 2. press Shift-u (the default GOTO key) to access the addressbar +# 3. press Ctrl-u to clear addressbar +# 4. to search duckduckgo type in dd:cool linux wallpapers +# 5. to search google type in gg:cool anime wallpapers +# CLI: $ w3m dd:archlinux +# $ w3m ya:debian,stable,iso +# $ w3m "gg:linux mint iso download" +# CLOG: +# 2021-07-28 add comma as space holder for cli (eg $ w3m ya:debian,stable,iso ) +# 2021-07-24 remove semicolon requirements, use spaces instead by enabling (space_autocomplete 0) +# add optional direct cli usage info +# 2021-05-24 turn @felipesaa script into posix, use case statement looks prettier + +# search engine alias +PREFIX=$(echo "$QUERY_STRING" | cut -d ':' -f1) + +# user input keywords +INPUT=$(echo "$QUERY_STRING" | cut -d ':' -f2- | sed 's/,/%20/g') + +# check if w3m version has native gopher support +GOPHER_PROTOCOL_ENABLE=$(w3m -version | grep -c "gopher") + +case $PREFIX in + 1x) + echo "W3m-control: GOTO https://1337x.to/search/$INPUT/1/" + ;; + dd) + echo "W3m-control: GOTO https://lite.duckduckgo.com/lite/?q=$INPUT&kf=-1&kz=-1&kq=-1&kv=-1&k1=-1&kp=-2&kaf=1&kd=-1&kf=-1&kz=-1&kq=-1&kv=-1" + ;; + gg) + echo "W3m-control: GOTO https://www.google.com/search?q=$INPUT" + ;; + gs) + echo "W3m-control: GOTO https://portal.mozz.us/gemini/geminispace.info/search%3F$INPUT" + ;; + pb) + echo "W3m-control: GOTO https://thepiratebay10.org/search/$INPUT" + ;; + rd) # goto a subreddit by name + echo "W3m-control: GOTO https://www.reddit.com/r/$INPUT/.mobile" + ;; + wi) + echo "W3m-control: GOTO https://en.wikipedia.org/w/index.php?search=$INPUT&title=Special%3ASearch&profile=default&fulltext=1&ns0=1" + ;; + v2) # veronica-2 search gopherspace (use web proxy if no native support) + if [ "$GOPHER_PROTOCOL_ENABLE" = 0 ] ; then + echo "W3m-control: GOTO https://gopher.floodgap.com/gopher/gw?ss=gopher%3A%2F%2Fgopher.floodgap.com%2F7%2Fv2%2Fvs&sq=$INPUT" + else + echo "W3m-control: GOTO gopher://gopher.floodgap.com/7/v2/vs?$INPUT" + fi + ;; + ya) + echo "W3m-control: GOTO https://search.yahoo.com/search?p=$INPUT" + ;; + yt) # youtube via invidious (more instances @ https://redirect.invidious.io ) + echo "W3m-control: GOTO https://yewtu.be/search?q=$INPUT" + ;; +esac + +# delete temp buffer +echo "W3m-control: DELETE_PREVBUF" diff --git a/.w3m/config b/.w3m/config new file mode 100644 index 0000000..109b711 --- /dev/null +++ b/.w3m/config @@ -0,0 +1,72 @@ +cgi_bin /usr/lib/w3m/cgi-bin:/home/lxf/.w3m/cgi-bin +# Auto preview link url +display_link 1 +use_dictcommand 1 + +# Ascii entity renderings +graphic_char 2 + +# no images +display_image 0 + +# activate external image viewer +ext_image_viewer 1 +imgdisplay w3mimgdisplay + +color 1 +basic_color terminal +anchor_color green +image_color cyan +form_color blue +mark_color yellow +bg_color terminal +active_style 0 +visited_anchor 0 + + +# Misc settings + +use_history 1 +history 1000 +save_hist 1 +confirm_qq 1 +mark 1 +mark_all_pages 0 +wrap_search 1 +ignorecase_search 1 +keymap_file keymap + +# Open page in the default browser (vivaldi) +extbrowser xdg-open %s + +# Append url to $NOTES +extbrowser3 url=%s out_file='/home/lxf/inbox/new.txt' && echo $url >> $out_file && echo $url saved to $out_file && read s +extbrowser4 url=%s && jrnl @link $url && echo $url saved to journal && read s + +# Copy url to the tmux or the X paste buffer +extbrowser7 url=%s && printf %s "$url" | xargs tmux set-buffer +extbrowser8 url=%s && printf %s "$url" | xsel && printf %s "$url" | xsel -b & + +# Auto enable VIM html file type for editor command +editor vim -c "set filetype=html" + +# run external viewers/commands in background +bgextviewer 1 + +## Network settings +# Modify user-agent string and languages accepted +user_agent +accept_language en;q=1.0 + +# auto-populate with current URL in URL open command +default_url 1 + +# follow meta refresh +meta_refresh 1 +Cookie settings (likely default) +use_cookie 1 +show_cookie 0 +accept_cookie 1 +accept_bad_cookie 0 +cookie_reject_domains +cookie_accept_domains diff --git a/.w3m/cookie b/.w3m/cookie new file mode 100644 index 0000000..2c4cd43 --- /dev/null +++ b/.w3m/cookie @@ -0,0 +1,3 @@ +https://www.google.com/search?q=wired NID 511=j940M1piUAH3qHBInanL_hxZTMS71r6sHjd6gLudyuLPzaY-ooRUb0D8AywQjLg0uwHWWYG3CBHuDdYrhbMbp2xa_hig1E9BRYiUmzv9lUa-Q64vkfN6AbOEek5H_K228Yasp_vQgHqDd275q5tCZgQjpNQspgqAJcwk8usfFwo 1701367907 .google.com / 13 0 +https://www.google.com/search?q=wired AEC AUEFqZecdwRSl9abswjtH56D7k7RmNOARy0rc6cHEbNy7rEco_kuymoY9Rs 1701108707 .google.com / 15 0 +https://www.google.com/search?q=wired 1P_JAR 2023-05-31-18 1688148707 .google.com / 15 0 diff --git a/.w3m/keymap b/.w3m/keymap new file mode 100644 index 0000000..18cb2c1 --- /dev/null +++ b/.w3m/keymap @@ -0,0 +1,285 @@ +# First get rid of defaults +keymap K NULL +keymap J NULL +keymap SPC NULL +keymap - NULL +keymap + NULL +keymap C-v NULL +keymap ESC-v NULL +keymap C-f NULL +keymap C-b NULL +keymap C-n NULL +keymap C-p NULL +keymap < NULL +keymap > NULL +keymap . NULL +keymap , NULL +keymap ^ NULL +keymap C-a NULL +keymap W NULL +keymap ^[[6~ NULL +keymap ^[[5~ NULL +keymap g NULL +keymap ^[[1~ NULL +keymap ^[[4~ NULL +keymap ESC-< NULL +keymap ESC-> NULL +keymap [ NULL +keymap ] NULL +#keymap ^[[Z NULL #This is shift+tab +keymap ESC-m NULL +keymap ( NULL +keymap ) NULL +keymap C-j NULL +keymap C-m NULL +keymap ESC-C-j NULL +keymap ESC-C-m NULL +keymap ESC-w NULL +keymap ESC-W NULL +keymap C-s NULL +keymap = NULL +keymap ESC-l NULL +keymap U NULL +keymap V NULL +keymap v NULL +keymap R NULL +keymap ESC-s NULL +keymap : NULL +keymap C-q NULL +keymap T NULL +keymap } NULL +keymap { NULL +keymap ESC-a NULL +keymap ESC-b NULL +keymap c NULL +keymap ESC-: NULL +keymap C-h NULL +keymap q NULL +keymap Q NULL +keymap C-w NULL +keymap C-d NULL +keymap C-u NULL +keymap RIGHT NULL +keymap l NULL +keymap LEFT NULL +keymap h NULL +keymap j NULL +keymap DOWN NULL +keymap k NULL +keymap UP NULL +keymap C-e NULL +keymap C-y NULL +keymap 0 NULL +keymap $ NULL +keymap Z NULL +keymap z NULL +keymap ESC-g NULL +keymap gg NULL +keymap G NULL +keymap w NULL +keymap b NULL +keymap C-n NULL +keymap C-p NULL +#keymap ESC-TAB NULL +keymap f NULL +keymap C-o NULL +#keymap TAB NULL +keymap C-j NULL +keymap C-] NULL +keymap I NULL +keymap ESC-I NULL +keymap ESC-C-j NULL +keymap y NULL +keymap u NULL +keymap i NULL +keymap gC-g NULL +keymap C-g NULL +keymap ";" NULL +keymap M NULL +keymap ESC-M NULL +keymap F NULL +keymap ESC-u NULL +keymap t NULL +keymap @ NULL +keymap "#" NULL +keymap | NULL +keymap B NULL +keymap L NULL +keymap H NULL +keymap s NULL +keymap gf NULL +keymap S NULL +keymap E NULL +keymap ESC-e NULL +keymap C-r NULL +keymap r NULL +keymap C-l NULL +keymap C-t NULL +keymap d NULL +keymap gt NULL +keymap gT NULL +keymap ESC-t NULL +keymap C-wL NULL +keymap C-wH NULL +keymap a NULL +keymap n NULL +keymap N NULL +keymap / NULL +keymap ? NULL +keymap C-@ NULL +keymap ESC-n NULL +keymap ESC-p NULL +keymap \" NULL +keymap ^[[2~ NULL +keymap ^[[28~ NULL +keymap ^[[E NULL +keymap ^[[L NULL +keymap o NULL +keymap C-k NULL +keymap D NULL +keymap m NULL +keymap ESC-c NULL +keymap ESC-o NULL +keymap ESC-k NULL +keymap \\ NULL +keymap ! NULL +#keymap C-z NULL +keymap ZZ NULL +keymap ZQ NULL + +#urls operations................................................................ +#keymap PEEK #Show current page url. +#Focus in address bar. +keymap o GOTO +keymap C-l GOTO +#Focus in address bar. Open in new tab. +keymap O TAB_GOTO +keymap ef PEEK_LINK #Show link under cursor. +#Execute external browser = open current link in $BROWSER +#tip: number(2-9) + external browser shortcut(M-o) executes executes the +#external browser command linked to the prefix number. +#See "External Program Settings" in "Option Setting Panel"(OPTIONS) +#Open current link with external browser = sensible browser +keymap M-o EXTERN +#copy current url and remove newline at the end. +keymap yy EXTERN copy_url.sh +#keymap yy EXTERN "echo -n %s | xclip -i -selection clipboard" +#keymap yy EXTERN "echo -n %s | xsel -b" +#open link under cursor with external browser = sensible browser +keymap M-p EXTERN_LINK +#Copy link under cursor, It does not copy images urls +#keymap yf EXTERN_LINK 'env printf %s "$0" | xsel -b' +keymap yf EXTERN_LINK copy_url.sh +#follow link in clipboard in the current tab. +keymap p GOTO /usr/lib/w3m/cgi-bin/goto_clipboard.cgi +#follow link in clipboard in new foreground tab. +keymap P TAB_GOTO /usr/lib/w3m/cgi-bin/goto_clipboard.cgi +keymap F TAB_LINK #Follow link in a new foreground tab +#follow link under cursor in new background tab +#keymap COMMAND "TAB_LINK ; PREV_TAB" +keymap f GOTO_LINK #Follow link in current tab +keymap C-j GOTO_LINK #Follow link (Enter = Ctrl+j) + +#scrolling.................................................................... +#pager-like scrolling. +keymap k DOWN +keymap j UP +keymap l RIGHT +keymap h LEFT +keymap gg BEGIN #Go to the top. +#go to line number 5 "5G" +keymap G END #Go to the end. +#keymap C-d NEXT_PAGE +#keymap C-u PREV_PAGE +#Av. Pag = M-[6~ Re. Pag = M-[5~ +keymap M-[6~ NEXT_PAGE +keymap M-[5~ PREV_PAGE +keymap SPC NEXT_PAGE +#map Shift + space PREV_PAGE note: this is not present in default keymap +#Remap PageUp to Shitf + Space +#URxvt.keysym.Shift-space: \033[5~ +keymap zz CENTER_V #center vertical-screen in cursor position + +#-bookmarks.................................................................... +keymap C-d ADD_BOOKMARK #Add current page to bookmarks +keymap gb VIEW_BOOKMARK #Show bookmarks +keymap :b VIEW_BOOKMARK #Show bookmarks +keymap C-b VIEW_BOOKMARK #Show bookmarks + +#-search....................................................................... +keymap / ISEARCH #Enter find mode +keymap C-f ISEARCH #Enter find mode +keymap ? ISEARCH_BACK #Enter find mode backwards (incremental) +#support regex expressions +keymap n SEARCH_NEXT #Find next +keymap N SEARCH_PREV #Find previous + +#-Commands.................................................................... +#Execute w3m functions. +keymap ! COMMAND +keymap + HELP #View help +keymap * OPTIONS #Option setting panel +#keymap EXEC_SHELL #Execute shell command +#Send rendered document to pipe +keymap | PIPE_BUF +#Execute shell command and browse +#keymap PIPE_SHELL +#Reload configuration files. +keymap M-r REINIT +keymap q QUIT #Quit w3m with confirmation. +keymap ZZ EXIT #Quit w3m without confirmation. +keymap r RELOAD #Reload current page. +#keymap S INTERRUPT #Send w3m to background=C-z in bash + +#-save/load..................................................................... +#Save document source (html), sometimes download a gzip file (without extention) +keymap :w DOWNLOAD +keymap C-s DOWNLOAD +#Save redered document +keymap :W PRINT +#keymap ESC-C-J SUBMIT #e.g. execute search in google +#Load local file. +keymap C-o LOAD + +#-miscellany.................................................................... +keymap C-Y DOWNLOAD_LIST #Show download menu +keymap C-y DOWNLOAD_LIST #Show download menu +keymap :E EDIT_SCREEN #Edit current rendered document with sensible-editor +keymap :e EDIT #Edit current local file wtih sensible-editor + +keymap M-u LIST #Show list of all links, anchors and images +keymap M-m MOUSE_TOGGLE #Toggle activity of mouse +keymap M-i VIEW_IMAGE #pendant change SC.View image in extern viewer +keymap M-I DISPLAY_IMAGE +#Show Context menu. It has specific option for links under the cursor. +keymap M-c MENU + +#-word operations............................................................... +#send word interactively to specified dictionary +#keymap DICT_WORD +#send the word under cursor and send it to specified dictionary +#goldendict must be opened before if not w3m freezes. +#keymap a DICT_WORD_AT + +#tests.......................................................................... +#Folding lines for plain text files +keymap C-x COMMAND "SET_OPTION fold_line=toggle ; RESHAPE" +#keymap C-x DISPLAY_IMAGE +#keymap C-v MARK_URL +#keymap ; MARK_URL +#keymap C-z MAIN_MENU +#Execute search in search camp (useful when are no buttons to search +#in the non-javascript version) e.g., Youtube. +#keymap C-z SUBMIT +#keymap C-x MOUSE_TOGGLE +#keymap C-v PIPE_SHELL +# +# +# My custom bindings +keymap C-p COMMAND "SAVE_SCREEN /home/lxf/inbox/output.txt" +# Open current buffer in an external browser (app) +keymap pp COMMAND "PRINT /home/lxf/inbox/new.txt && mutt -s 'Article'" +## fzf search of commands +keymap xx COMMAND "READ_SHELL ~/.w3m/cgi-bin/fnx_fzfmiru.cgi ; BACK ; GOTO file:/cgi-bin/fnx_execute.cgi ; BACK" +keymap sg COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_google.cgi ; DICT_WORD" +keymap sb COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_brave.cgi ; DICT_WORD" |