mirror of
https://github.com/Phantop/dotfiles
synced 2024-11-22 06:42:46 +00:00
Qute: update to 2.0.0 and split config
This commit is contained in:
parent
7da33d7301
commit
0233bf99c8
|
@ -25,6 +25,5 @@ loop
|
|||
aid = no
|
||||
sid = no
|
||||
start = 0
|
||||
panscan = 1
|
||||
load-scripts = no
|
||||
no-stop-screensaver
|
||||
|
|
43
.config/qutebrowser/adapta.py
Normal file
43
.config/qutebrowser/adapta.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
cc = c.colors
|
||||
ccc = cc.completion
|
||||
cct = cc.tabs
|
||||
|
||||
guicol = '#222D32'
|
||||
accent = '#5294E2'
|
||||
|
||||
cc.downloads.bar.bg = guicol
|
||||
cc.prompts.bg = guicol
|
||||
cc.statusbar.command.bg = guicol
|
||||
cc.statusbar.command.private.bg = guicol
|
||||
cc.statusbar.normal.bg = guicol
|
||||
cc.statusbar.private.bg = guicol
|
||||
ccc.category.bg = guicol
|
||||
ccc.scrollbar.bg = guicol
|
||||
cct.bar.bg = guicol
|
||||
cct.even.bg = guicol
|
||||
cct.odd.bg = guicol
|
||||
cct.pinned.even.bg = guicol
|
||||
cct.pinned.odd.bg = guicol
|
||||
|
||||
ccc.item.selected.bg = accent
|
||||
ccc.item.selected.border.bottom = accent
|
||||
ccc.item.selected.border.top = accent
|
||||
ccc.match.fg = accent
|
||||
ccc.scrollbar.fg = accent
|
||||
cct.pinned.selected.even.bg = accent
|
||||
cct.pinned.selected.odd.bg = accent
|
||||
cct.selected.even.bg = accent
|
||||
cct.selected.odd.bg = accent
|
||||
|
||||
cct.selected.even.fg = 'black'
|
||||
cct.selected.odd.fg = 'black'
|
||||
cct.pinned.selected.even.fg = 'black'
|
||||
cct.pinned.selected.odd.fg = 'black'
|
||||
cc.messages.warning.fg = 'white'
|
||||
|
||||
ccc.even.bg = '#29353B'
|
||||
ccc.odd.bg = '#243035'
|
||||
c.hints.border = '1px solid #00A5BA'
|
||||
cc.hints.bg = 'rgba(0, 226, 255, 0.8)'
|
||||
cc.messages.warning.bg = 'red'
|
||||
cc.messages.warning.border = 'red'
|
23
.config/qutebrowser/bindings.py
Normal file
23
.config/qutebrowser/bindings.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
bind = {
|
||||
'<Ctrl-q>': 'close',
|
||||
'<Ctrl-r>': 'spawn -u readability',
|
||||
'<Ctrl-w>': 'tab-close',
|
||||
'<Ctrl-Shift-R>': 'spawn kitty rdrview -B qutebrowser {url}',
|
||||
|
||||
'm': 'mpv {url}',
|
||||
'M': 'mpv4 {url}',
|
||||
',': 'hint links run mpv {hint-url}',
|
||||
';m': 'hint links run mpv {hint-url}',
|
||||
';M': 'hint links run mpv4 {hint-url}',
|
||||
|
||||
's1': 'download-open',
|
||||
'sa': 'open https://archive.is/?run=1&url={url}',
|
||||
'sc': 'config-cycle -t content.user_stylesheets adapta.css ""',
|
||||
'sd': "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'",
|
||||
'sg': 'debug-dump-page ~/Downloads/dump.html',
|
||||
'sq': 'spawn -u qr',
|
||||
'sr': 'remove-sticky',
|
||||
'st': 'config-cycle -t content.proxy socks://localhost:9050/ system',
|
||||
}
|
||||
for a, b in bind.items():
|
||||
config.bind(a, b)
|
|
@ -1,151 +1,50 @@
|
|||
invid = 'invidious.fdn.fr'
|
||||
nittr = 'nitter.snopyta.org'
|
||||
config.load_autoconfig(False)
|
||||
config.source('adapta.py')
|
||||
config.source('bindings.py')
|
||||
config.source('redirects.py')
|
||||
|
||||
# BEGIN MAIN CONFIGURATION #
|
||||
c.url.default_page = "https://feedly.com/i/my"
|
||||
c.url.start_pages = ["https://duck.com/?q=20m+timer"]
|
||||
c.url.searchengines['y'] = "localhost" + "/search?q={}"
|
||||
c.url.default_page = "feedly.com/i/my"
|
||||
c.url.start_pages = ["duck.com/?q=20m timer"]
|
||||
c.url.searchengines['y'] = "localhost/search?q={}"
|
||||
|
||||
c.content.fullscreen.window = True
|
||||
c.downloads.location.prompt = False
|
||||
c.input.insert_mode.auto_leave = False
|
||||
c.scrolling.smooth = True
|
||||
c.url.open_base_url = True
|
||||
|
||||
c.completion.open_categories = ["quickmarks", "bookmarks", "history"]
|
||||
c.tabs.show = "multiple"
|
||||
c.fonts.default_size = "9pt"
|
||||
c.content.fullscreen.window = True
|
||||
c.qt.force_platformtheme = "gtk2"
|
||||
|
||||
c.content.cookies.accept = "no-3rdparty"
|
||||
c.input.insert_mode.auto_leave = False
|
||||
c.downloads.location.prompt = False
|
||||
c.url.open_base_url = True
|
||||
c.tabs.background = True
|
||||
c.content.dns_prefetch = True
|
||||
c.confirm_quit = ["downloads"]
|
||||
c.scrolling.smooth = True
|
||||
c.content.cookies.accept = "no-3rdparty"
|
||||
c.fonts.default_size = "9pt"
|
||||
c.qt.args += ["enable-gpu-rasterization"]
|
||||
c.qt.force_platformtheme = "gtk2"
|
||||
c.tabs.show = "multiple"
|
||||
|
||||
hosts = c.content.host_blocking.lists
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/facebook/all-but-whatsapp")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/microsoft/all")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/twitter/all")
|
||||
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.notifications', 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')
|
||||
|
||||
# BINDINGS #
|
||||
config.bind('<Ctrl-q>', 'close')
|
||||
config.bind('<Ctrl-w>', 'tab-close')
|
||||
|
||||
config.bind('c1', 'download-open')
|
||||
config.bind('gs', 'debug-dump-page ~/Downloads/dump.html')
|
||||
config.bind('sd', "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'")
|
||||
ccw = c.colors.webpage
|
||||
ccwd = ccw.darkmode
|
||||
ccwd.enabled = True
|
||||
ccwd.policy.images = 'never'
|
||||
ccw.prefers_color_scheme_dark = True
|
||||
|
||||
mpv = 'spawn -m -d -v mpv --ytdl-raw-options=write-sub=,write-auto-sub=,embed-subs=,sub-lang=en'
|
||||
c.aliases['mpv'] = mpv
|
||||
config.bind('m', 'mpv {url}')
|
||||
config.bind(';m', 'hint links run mpv {hint-url}')
|
||||
config.bind(',', 'hint links run mpv {hint-url}')
|
||||
|
||||
c.aliases['mpv4'] = mpv + ' --ytdl-format=bestvideo[vcodec^=avc1]+bestaudio'
|
||||
config.bind('M', 'mpv4 {url}')
|
||||
config.bind(';M', 'hint links run mpv4 {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}')
|
||||
config.bind('se', 'open https://dotepub.com/converter/?url={url}&fmt=epub')
|
||||
|
||||
c.aliases['remove-sticky'] = 'jseval -q !function(){var e,o=document.querySelectorAll("body *");for(e=0;e<o.length;e++)["sticky","fixed"].includes(getComputedStyle(o[e]).position)&&o[e].parentNode.removeChild(o[e])}();'
|
||||
config.bind('sr', 'remove-sticky')
|
||||
|
||||
config.bind('<Ctrl-r>', 'spawn -u /usr/bin/env python3 /usr/share/qutebrowser/userscripts/readability')
|
||||
config.bind('<Ctrl-Shift-R>', 'spawn kitty rdrview -B qutebrowser {url}')
|
||||
c.content.blocking.method = "both"
|
||||
hosts = c.content.blocking.hosts.lists
|
||||
hosts.append("https://github.com/Perflyst/PiHoleBlocklist/raw/master/AmazonFireTV.txt")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/twitter/all")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/microsoft/all")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/facebook/all-but-whatsapp")
|
||||
|
||||
config.bind('st', 'config-cycle -t content.proxy socks://localhost:9050/ system')
|
||||
config.bind('sc', 'config-cycle -t content.user_stylesheets adapta.css ""')
|
||||
config.set('content.persistent_storage', True, 'https://mega.nz')
|
||||
config.set('content.desktop_capture', True, 'https://discord.com')
|
||||
config.set('content.media.audio_capture', True, 'https://discord.com')
|
||||
config.set('content.notifications', True, 'https://mail.tutanota.com')
|
||||
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')
|
||||
|
||||
# APPEARANCE #
|
||||
guicol = '#222D32'
|
||||
accent = '#5294E2'
|
||||
|
||||
cc = c.colors
|
||||
cct = cc.tabs
|
||||
ccc = cc.completion
|
||||
ccw = cc.webpage
|
||||
|
||||
ccwd = ccw.darkmode
|
||||
ccw.prefers_color_scheme_dark = True
|
||||
ccwd.enabled = True
|
||||
ccwd.policy.images = 'never'
|
||||
|
||||
ccc.category.bg = guicol
|
||||
ccc.scrollbar.bg = guicol
|
||||
cc.downloads.bar.bg = guicol
|
||||
cc.prompts.bg = guicol
|
||||
cc.statusbar.command.bg = guicol
|
||||
cc.statusbar.command.private.bg = guicol
|
||||
cc.statusbar.normal.bg = guicol
|
||||
cc.statusbar.private.bg = guicol
|
||||
cct.bar.bg = guicol
|
||||
cct.even.bg = guicol
|
||||
cct.odd.bg = guicol
|
||||
cct.pinned.even.bg = guicol
|
||||
cct.pinned.odd.bg = guicol
|
||||
|
||||
cct.selected.even.fg = 'black'
|
||||
cct.selected.odd.fg = 'black'
|
||||
cct.pinned.selected.even.fg = 'black'
|
||||
cct.pinned.selected.odd.fg = 'black'
|
||||
|
||||
cc.hints.bg = 'rgba(0, 226, 255, 0.8)'
|
||||
c.hints.border = '1px solid #00A5BA'
|
||||
|
||||
cct.selected.even.bg = accent
|
||||
cct.selected.odd.bg = accent
|
||||
cct.pinned.selected.even.bg = accent
|
||||
cct.pinned.selected.odd.bg = accent
|
||||
ccc.even.bg = '#29353B'
|
||||
ccc.odd.bg = '#243035'
|
||||
ccc.item.selected.bg = accent
|
||||
ccc.item.selected.border.top = accent
|
||||
ccc.item.selected.border.bottom = accent
|
||||
ccc.match.fg = accent
|
||||
ccc.scrollbar.fg = accent
|
||||
|
||||
# REDIRECTS #
|
||||
from qutebrowser.api import interceptor
|
||||
import operator, typing
|
||||
REDIRECT_MAP = {
|
||||
"reddit.com": operator.methodcaller('setHost', 'teddit.net'),
|
||||
"www.reddit.com": operator.methodcaller('setHost', 'teddit.net'),
|
||||
"twitter.com": operator.methodcaller('setHost', nittr),
|
||||
"api.twitter.com": operator.methodcaller('setHost', nittr),
|
||||
"platform.twitter.com": operator.methodcaller('setHost', nittr),
|
||||
"www.platform.twitter.com": operator.methodcaller('setHost', nittr),
|
||||
"mobile.twitter.com": operator.methodcaller('setHost', nittr),
|
||||
"www.youtube.com": operator.methodcaller('setHost', invid),
|
||||
"youtube.com": operator.methodcaller('setHost', invid),
|
||||
"youtu.be": operator.methodcaller('setHost', invid),
|
||||
"www.instagram.com": operator.methodcaller('setHost', 'bibliogram.snopyta.org'),
|
||||
}
|
||||
def int_fn(info: interceptor.Request):
|
||||
"""Block the given request if necessary."""
|
||||
if (info.resource_type != interceptor.ResourceType.main_frame or
|
||||
info.request_url.scheme() in {"data", "blob"}):
|
||||
return
|
||||
url = info.request_url
|
||||
redir = REDIRECT_MAP.get(url.host())
|
||||
if redir is not None and redir(url) is not False:
|
||||
info.redirect(url)
|
||||
interceptor.register(int_fn)
|
||||
|
||||
# DRACULA #
|
||||
#import dracula.draw
|
||||
#dracula.draw.blood(c, {
|
||||
# 'spacing': {
|
||||
# 'vertical': 1,
|
||||
# 'horizontal': 0
|
||||
# }
|
||||
#})
|
||||
#dracula.draw.blood(c, {'spacing': {'vertical': 1,'horizontal': 0}})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
docs https://docs.google.com
|
||||
class https://classroom.google.com
|
||||
drive https://drive.google.com
|
||||
tuta https://mail.tutanota.com
|
||||
discord https://discord.com/app
|
||||
hn https://news.ycombinator.com
|
||||
docs https://docs.google.com
|
||||
drive https://drive.google.com
|
||||
drop https://drop.lol
|
||||
hn https://news.ycombinator.com
|
||||
tuta https://mail.tutanota.com
|
||||
|
|
30
.config/qutebrowser/redirects.py
Normal file
30
.config/qutebrowser/redirects.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
invid = 'invidious.fdn.fr'
|
||||
nitter = 'nitter.snopyta.org'
|
||||
reddit = 'teddit.net'
|
||||
|
||||
from qutebrowser.api import interceptor
|
||||
import operator, typing
|
||||
REDIRECT_MAP = {
|
||||
"reddit.com": operator.methodcaller('setHost', reddit),
|
||||
"www.reddit.com": operator.methodcaller('setHost', reddit),
|
||||
"old.reddit.com": operator.methodcaller('setHost', reddit),
|
||||
"twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"api.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"platform.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"www.platform.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"mobile.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"www.youtube.com": operator.methodcaller('setHost', invid),
|
||||
"youtube.com": operator.methodcaller('setHost', invid),
|
||||
"youtu.be": operator.methodcaller('setHost', invid),
|
||||
"www.instagram.com": operator.methodcaller('setHost', 'bibliogram.snopyta.org'),
|
||||
}
|
||||
def int_fn(info: interceptor.Request):
|
||||
"""Block the given request if necessary."""
|
||||
if (info.resource_type != interceptor.ResourceType.main_frame or
|
||||
info.request_url.scheme() in {"data", "blob"}):
|
||||
return
|
||||
url = info.request_url
|
||||
redir = REDIRECT_MAP.get(url.host())
|
||||
if redir is not None and redir(url) is not False:
|
||||
info.redirect(url)
|
||||
interceptor.register(int_fn)
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
list=$(grep works/[0-9]\* $@ -o | uniq | grep -o [0-9]\* | tr '\n' , | sed s/.$//)
|
||||
list=$(grep works/[0-9]\* "$@" -o | uniq | grep -o [0-9]\* | tr '\n' , | sed s/.$//)
|
||||
eval aria2c -Z https://download.archiveofourown.org/downloads/{$list}/\*.epub -d ao3
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/sh
|
||||
if [[ "$#" -ge 1 ]]; then
|
||||
rm ~/Pictures/.wallp
|
||||
ln -s ~/Pictures/Awall/$@* ~/Pictures/.wallp
|
||||
echo ~/Pictures/Awall/$@* > ~/Pictures/.wallp
|
||||
fi
|
||||
pkill -f "mpv.*wallpaper"
|
||||
xwinwrap -ni -fdt -fs -- mpv -wid WID ~/Pictures/.wallp --profile=wallpaper & disown
|
||||
xwinwrap -ni -fdt -fs -- mpv -wid WID $(cat ~/Pictures/.wallp) --profile=wallpaper & disown
|
||||
if [[ "$#" -ge 1 ]]; then
|
||||
ffmpeg -i ~/Pictures/.wallp -vframes 1 -y ~/Pictures/Awall/wall.png
|
||||
gsettings set org.gnome.desktop.background picture-uri "file://$HOME/Pictures/Awall/wall.png"
|
||||
ffmpeg -i $(cat ~/Pictures/.wallp) -vframes 1 -y ~/Pictures/Awall/wall.png
|
||||
convert ~/Pictures/Awall/wall.png -interpolate Integer -filter point -resize 1920x1080 -gravity center -background black -extent 1920x1080 ~/Pictures/Awall/wall.png
|
||||
gsettings set org.gnome.desktop.background picture-uri file://$HOME/.config/kitty/wall.png
|
||||
gsettings set org.gnome.desktop.background picture-uri file://$HOME/Pictures/Awall/wall.png
|
||||
fi
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
fd -e pdf -x cpdfsqueeze {} {}
|
||||
fd -e png -x oxipng
|
||||
fd -e epub -e zip -x advzip -z4
|
||||
fd -e epub -e zip -e cbz -x advzip -z4
|
||||
fd -e jpg -e jpeg -x jpegoptim
|
||||
|
|
Loading…
Reference in a new issue