Setup & Qute: cleanup

This commit is contained in:
Phantop 2020-10-23 23:45:26 -04:00
parent a5958eca98
commit 30448f746b
2 changed files with 29 additions and 30 deletions

View File

@ -1,30 +1,6 @@
invid = 'invidious.fdn.fr'
nittr = 'nitter.snopyta.org'
# bindings
config.bind('<Ctrl-q>', 'close')
config.bind('<Ctrl-w>', 'tab-close')
config.bind('sd', 'spawn -u downloads')
config.bind('<Ctrl-r>', 'spawn -u readability')
c.aliases['mpv'] = "spawn -m -d -v mpv --ytdl-raw-options=write-sub=,write-auto-sub=,embed-subs=,sub-lang=en}"
config.bind('<Ctrl-m>', 'mpv {url}')
config.bind('<Ctrl-Shift-M>', 'mpv --ytdl-format=bestvideo[vcodec^=avc1]+bestaudio {url}')
config.bind('<,>', 'hint links run mpv {hint-url}')
config.bind('sq', 'open qr {url}')
config.bind('sa', 'open https://archive.is/?run=1&url={url}')
config.bind('sw', 'open https://conifer.rhizome.org/record/{url}')
c.aliases['dotepub'] = "jseval --url javascript:(function()%7Btry%7Bvar%20d=document,w=window;if(!d.body%7C%7Cd.body.innerHTML=='')throw(0);var%20s=d.createElement('link'),h=d.getElementsByTagName('head')[0],i=d.createElement('div'),j=d.createElement('script');s.rel='stylesheet';s.href='//dotepub.com/s/dotEPUB-favlet.css';s.type='text/css';s.media='screen';h.appendChild(s);i.setAttribute('id','dotepub');i.innerHTML='%3Cdiv%20id=%22status%22%3E%3Cp%3EConversion%20in%20progress...%3C/p%3E%3C/div%3E';d.body.appendChild(i);j.type='text/javascript';j.charset='utf-8';j.src='//dotepub.com/j/dotepub.js?v=1.2&s=ask&t=epub&g=en';h.appendChild(j);%7Dcatch(e)%7Bw.alert('The%20page%20has%20no%20content%20or%20it%20is%20not%20fully%20loaded.%20Please,%20wait%20till%20the%20page%20is%20loaded.');%7D%7D)();"
config.bind('se', "dotepub")
c.aliases['remove-sticky'] = "jseval --url javascript:(function()%7B%20let%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3B%20for%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7B%20if(getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'fixed'%20%7C%7C%20getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'sticky')%7B%20elements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%20%7D%20%7D%20%7D)()"
config.bind('sr', "remove-sticky")
config.bind('st', 'config-cycle -t content.proxy socks://localhost:9050/ system')
config.bind('sca', 'config-cycle -t content.user_stylesheets adapta.css ""')
# BEGIN MAIN CONFIGURATION #
c.url.default_page = "https://feedly.com/i/my"
c.url.start_pages = ["https://duckduckgo.com/?q=20m+timer"]
@ -51,13 +27,37 @@ hosts.append("https://raw.githubusercontent.com/jmdugan/blocklists/master/corpor
hosts.append("https://github.com/Perflyst/PiHoleBlocklist/raw/master/AmazonFireTV.txt")
config.set('content.register_protocol_handler', True, 'https://mail.tutanota.com')
config.set('content.register_protocol_handler', False, 'https://mail.google.com?extsrc=mailto&url=%25s')
config.set('content.desktop_capture', True, 'https://discord.com')
config.set('content.media.audio_capture', True, 'https://discord.com')
config.set('content.persistent_storage', True, 'https://mega.nz')
config.set('content.javascript.enabled', False, 'https://twitter.com')
config.set('content.register_protocol_handler', False, 'https://mail.google.com?extsrc=mailto&url=%25s')
## APPEARANCE ##
# BINDINGS #
config.bind('<Ctrl-q>', 'close')
config.bind('<Ctrl-w>', 'tab-close')
config.bind('sd', 'spawn -u downloads')
config.bind('<Ctrl-r>', 'spawn -u readability')
c.aliases['mpv'] = "spawn -m -d -v mpv --ytdl-raw-options=write-sub=,write-auto-sub=,embed-subs=,sub-lang=en}"
config.bind('<Ctrl-m>', 'mpv {url}')
config.bind('<Ctrl-Shift-M>', 'mpv --ytdl-format=bestvideo[vcodec^=avc1]+bestaudio {url}')
config.bind('<,>', 'hint links run mpv {hint-url}')
config.bind('sq', 'open qr {url}')
config.bind('sa', 'open https://archive.is/?run=1&url={url}')
config.bind('sw', 'open https://conifer.rhizome.org/record/{url}')
c.aliases['dotepub'] = "jseval -u -q javascript:(function()%7Btry%7Bvar%20d=document,w=window;if(!d.body%7C%7Cd.body.innerHTML=='')throw(0);var%20s=d.createElement('link'),h=d.getElementsByTagName('head')[0],i=d.createElement('div'),j=d.createElement('script');s.rel='stylesheet';s.href='//dotepub.com/s/dotEPUB-favlet.css';s.type='text/css';s.media='screen';h.appendChild(s);i.setAttribute('id','dotepub');i.innerHTML='%3Cdiv%20id=%22status%22%3E%3Cp%3EConversion%20in%20progress...%3C/p%3E%3C/div%3E';d.body.appendChild(i);j.type='text/javascript';j.charset='utf-8';j.src='//dotepub.com/j/dotepub.js?v=1.2&s=ask&t=epub&g=en';h.appendChild(j);%7Dcatch(e)%7Bw.alert('The%20page%20has%20no%20content%20or%20it%20is%20not%20fully%20loaded.%20Please,%20wait%20till%20the%20page%20is%20loaded.');%7D%7D)();"
config.bind('se', "dotepub")
c.aliases['remove-sticky'] = "jseval -u -q javascript:(function()%7B%20let%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3B%20for%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7B%20if(getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'fixed'%20%7C%7C%20getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'sticky')%7B%20elements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%20%7D%20%7D%20%7D)()"
config.bind('sr', "remove-sticky")
config.bind('st', 'config-cycle -t content.proxy socks://localhost:9050/ system')
config.bind('sca', 'config-cycle -t content.user_stylesheets adapta.css ""')
# APPEARANCE #
guicol = '#222D32'
accent = '#5294E2'
@ -101,7 +101,7 @@ ccc.item.selected.border.bottom = accent
ccc.match.fg = accent
ccc.scrollbar.fg = accent
# redirects
# REDIRECTS #
from qutebrowser.api import interceptor
import operator, typing
REDIRECT_MAP = {
@ -111,7 +111,6 @@ REDIRECT_MAP = {
"api.twitter.com": operator.methodcaller('setHost', nittr),
"platform.twitter.com": operator.methodcaller('setHost', nittr),
"www.platform.twitter.com": operator.methodcaller('setHost', nittr),
"t.co": operator.methodcaller('setHost', nittr),
"mobile.twitter.com": operator.methodcaller('setHost', nittr),
"www.youtube.com": operator.methodcaller('setHost', invid),
"youtube.com": operator.methodcaller('setHost', invid),

2
.setup
View File

@ -18,7 +18,7 @@ stow .
mkdir -p ~/.config/mpv/shaders; cd ~/.config/mpv/shaders
curl -fsSL $(curl -fsSL https://api.github.com/repos/bloc97/Anime4K/releases/latest | jq .assets[].browser_download_url | sed 's/"//g') | busybox unzip -
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://github.com/junegunn/vim-plug/raw/master/plug.vim
nvim +PlugUpdate +q +q
curl -fsSL https://starship.rs/install.sh | sudo bash -s -- -b /usr/bin -y