updated w3m cgi-bin scripts and notes
parent
a6a71e3722
commit
20554fc6cd
@ -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"
|
@ -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"
|
@ -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"
|
@ -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/w3m_clipboard.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"
|
@ -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"
|
||||
|
@ -0,0 +1,14 @@
|
||||
#!/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"
|
@ -1,37 +0,0 @@
|
||||
#!/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
|
||||
# DEPEND: w3m xsel
|
||||
# RQMTS: 1. allow permissions and put this script in /usr/lib/w3m/cgi-bin/
|
||||
#
|
||||
# 2. $EDITOR ~/.w3m/keymap
|
||||
# # paste url and go (current tab)
|
||||
# keymap pp GOTO /usr/lib/w3m/cgi-bin/goto_clipboard.cgi
|
||||
#
|
||||
# # paste url and go (new tab)
|
||||
# keymap PP TAB_GOTO /usr/lib/w3m/cgi-bin/goto_clipboard.cgi
|
||||
#
|
||||
# 3. set the default open-url to current url
|
||||
# sed -i 's:default_url.*:default_url 1:g' ~/.w3m/config
|
||||
#
|
||||
# REFF: https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m
|
||||
# CLOG: 2021-02-05 version 0.2 reset url back to 1 (aka edit current url)
|
||||
# 2018-09-30 version 0.1 by felipesaa (https://github.com/felipesaa)
|
||||
|
||||
|
||||
# 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 "W3m-control: DELETE_PREVBUF\r\n"
|
||||
|
||||
# set default open-url value to one (aka current url)
|
||||
printf "%s\r\n" "W3m-control: SET_OPTION default_url=1";
|
||||
|
@ -1,37 +0,0 @@
|
||||
#!/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
|
||||
# DEPEND: w3m xsel
|
||||
# RQMTS: 1. allow permissions and put this script in /usr/lib/w3m/cgi-bin/
|
||||
#
|
||||
# 2. $EDITOR ~/.w3m/keymap
|
||||
# # paste url and go (current tab)
|
||||
# keymap pp GOTO /usr/lib/w3m/cgi-bin/goto_clipboard_primary.cgi
|
||||
#
|
||||
# # paste url and go (new tab)
|
||||
# keymap PP TAB_GOTO /usr/lib/w3m/cgi-bin/goto_clipboard_primary.cgi
|
||||
#
|
||||
# 3. set the default open-url to current url
|
||||
# sed -i 's:default_url.*:default_url 1:g' ~/.w3m/config
|
||||
#
|
||||
# REFF: https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m
|
||||
# CLOG: 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 "W3m-control: DELETE_PREVBUF\r\n"
|
||||
|
||||
# set default open-url value to one (aka current url)
|
||||
printf "%s\r\n" "W3m-control: SET_OPTION default_url=1";
|
||||
|
@ -1,37 +0,0 @@
|
||||
#!/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
|
||||
# DEPEND: w3m tmux
|
||||
# RQMTS: 1. allow permissions and put this script in /usr/lib/w3m/cgi-bin/
|
||||
#
|
||||
# 2. $EDITOR ~/.w3m/keymap
|
||||
# # paste url and go (current tab)
|
||||
# keymap pp GOTO /usr/lib/w3m/cgi-bin/goto_tmux_clipboard.cgi
|
||||
#
|
||||
# # paste url and go (new tab)
|
||||
# keymap PP TAB_GOTO /usr/lib/w3m/cgi-bin/goto_tmux_clipboard.cgi
|
||||
#
|
||||
# 3. set the default open-url to current url
|
||||
# sed -i 's:default_url.*:default_url 1:g' ~/.w3m/config
|
||||
#
|
||||
# REFF: https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m
|
||||
# CLOG: 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 "W3m-control: DELETE_PREVBUF\r\n"
|
||||
|
||||
# set default open-url value to one (aka current url)
|
||||
printf "%s\r\n" "W3m-control: SET_OPTION default_url=1";
|
||||
|
Loading…
Reference in New Issue